Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2006-05-25 10:20:25


Martin Bonner wrote:
> Thorsten Ottosen wrote:
>
>>Maybe you should just wrap boost::array:
>>
>>template< class T, unsigned N >
>>struct my_array : boost::array<T,N>
>>{
>> // provide constructors here
>
>
> How?
>
>
>>};
>
>
>
> You can't construct the base boost_array in the base class
> initialization list of the constructor (because boost_array doesn't have
> a constructor that takes arguments), and by the time you get into the
> body of the my_array constructor it is too late - the boost_array is
> already default constructed.

What do tou mean by "it's too late"?

Since the "construction" of boost::array is a no-op, you can just
initialize it in the body my_array's contructors.

-Thorsten


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