
On 5/25/06, AlisdairM <alisdair.meredith@uk.renaultf1.com> wrote:
I have been thinking this over all day, and think another class is the most sensible solution - even if it means duplicating the implementation. The extra boolean value in the type is just too ugly! Open to suggestions on a name though, other than array2 or arrayex <g>
Brainstorm: constructible_array static_vector ??? If we look forwards to C++0x and the new initialization syntax Bjarne
proposed in Berlin, I think we can see a way to implement an array template with constructors, as the new sequence constructor should remove the limits of aggregate compatibility from us. The data() member will still allow us to pass the internal array as a POD to C APIs.
Of course, once we allow for an array with constructors, we need to decide which constructors are most appropriate. Eg construction from an iterator range? Construction from a generator function? N copies of a give value?
I personnally want: -default constructor -copy constructor -range constructor -single value constructor (assigns the value to all the elements) -constructor with N parameters (N being the size of the array)