shared_array: how to get the number of elements in it?

Boosters, I want to write a function which compares two shared_array's element-wise (operator==() compares for pointer equality). How to get the number of elements a given shared_array contains? At first glance there seems to be no possibility; am I missing something? - Roland

On Mon, 01 Mar 2004 13:32:12 +0100, Roland Richter <roland@flll.jku.at> wrote:
Boosters,
I want to write a function which compares two shared_array's element-wise (operator==() compares for pointer equality).
How to get the number of elements a given shared_array contains? At first glance there seems to be no possibility; am I missing something?
You can't do it (just as with ordinary pointers), at least not without resorting to platform specific hacks. You probably want std::vector. Tom -- C++ FAQ: http://www.parashift.com/c++-faq-lite/ C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
participants (2)
-
Roland Richter
-
Tom Widmer