Boost logo

Boost :

From: Loïc Joly (loic.actarus.joly_at_[hidden])
Date: 2005-06-01 02:32:24


AlisdairM a écrit :

> Aggregate initialization is an important part of the array concept,
> allowing it to act largely as a plug-in replacement for language
> arrays, with the bonus it can be passed by value as well as by
> reference. The main drawback here is that we cannot deduce the size of
> a boost::array, as you can with a language array.

 From my point of view, the main drawback is that in the following code:

vector<double> v1(6);
array<double, 6> v2;

v1's content is initialized, v2's content is not. In fact, array is
about the only class I know of that as a default constructor that does
not initialize member data to a legal and documented value. This I
strongly dislike.

By the way, I also dislike the fact that double d; does not initialize
d, but at least people know that fundamental type do not behave well
when initialization is concerned.

-- 
Loïc

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