Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2006-05-25 11:36:55


Martin Bonner wrote:
> ----Original Message----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Thorsten Ottosen

>>What do tou mean by "it's too late"?
>
>
> What I mean is, you can't construct the elements of the boost_array at
> that point.
>
>>Since the "construction" of boost::array is a no-op, you can just
>>initialize it in the body my_array's contructors.
>
>
> I guess it depends what you want to use my_array for. If you are trying
> to hold primitive types, then that wrapping works fine. If you are
> trying to hold objects of a class type that doesn't even /have/ a
> default constructor, then it just won't work! (and yes, you can put such
> objects in a boost_array on a compliant compiler).

I see.

It's quite hard to see a solution to this without changing array.

One might argue that aggregate initialization is less important
when we can say

   array<int,4> = make_array<4>(1)(2)(3)(4);

but I guess some people would be against that.

-Thorsten


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