|
Boost : |
From: nbecker_at_[hidden]
Date: 2002-02-13 07:48:39
>>>>> "garcia" == garcia <rgarcia1771> writes:
garcia> --- In boost_at_y..., nbecker_at_f... wrote:
>> Default constructed array is then resized to the correct size.
garcia> Could you provide a code example that shows where this functionality
garcia> is needed? It seems dangerous to have the copy semantics of an array
garcia> depend upon whether or not it was default constructed, not to mention
garcia> whether it had been copied to already or not.
I think it is easy to think of examples where the size is not known at
construction time. For example, an array that is a member of a
class. Default constructor is used because we don't know the correct
size when the class is constructed. Later when a class member
function is called, the size is known and the array is resized.
I don't know why you say "have the copy semantics of an array depend
upon whether or not it was default constructed..." Are you saying
that in order to allow resizing that this is a necessary consequence?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk