Boost logo

Boost :

From: Schaible, Joerg (joerg.schaible_at_[hidden])
Date: 2000-12-12 07:19:07


Hi Joe,
 
this is not in the scope of this class. Since you cannot request the size
from an array you've allocated dynamically, the shared_array cannot report
either.
 
Greetings,
Jörg
 
-----Ursprüngliche Nachricht-----
Von: Joe Gottman [mailto:joegottman_at_[hidden]]
Gesendet: Dienstag, 12. Dezember 2000 02:51
An: boost_at_[hidden]
Betreff: [boost] shared_array.size()

    I have been using the shared_ptr from "smart_ptr.hpp" and have found it
very useful. However, I am afraid to try using the shared_array from the
same file. The problem is that shared_array does not have a size() member
function. This makes it very dangerous to use the shared_array if the user
doesn't know what size array it was created with, for instance if it was
returned from a function.
 
   I think the shared_array would be much more useful with a size() member.
However, this would necessitate changing the constructor and the reset()
function to take an extra parameter to indicate the size. Also, it would
necessitate using a third pointer to store the size.
 
Joe Gottman



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk