Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-05-31 17:49:38

"christopher diggins" <cdiggins_at_[hidden]> wrote in message
| ----- Original Message -----
| From: "Allen" <yaozhen_at_[hidden]>
| To: <boost_at_[hidden]>
| Sent: Tuesday, May 31, 2005 1:29 PM
| Subject: [boost] Re: Boost Array Initialization Technique
| > Did you see the Boost Assign Library:
| >
| >
| Yes. However, unless I am mistaken, it can only be used with back-insertable
| containers. There are of course other techniques than the one I proposed. My
| point is that I believe comma initialization to be superior to aggregate
| initialization, and that not making boost:array a conformant reversible
| container to be a mistake.

in the new boost, we might say

array<int,5> a;
a = cref_list_of<5>(1)(2)(3)(4)(5);

if efficiency is important. Missing values are inserted as 0,
and bounds are checked otherwise.

The real benefit is of course when dealing with classes:

struct X
    X(int, int)

array<X,4> a;
a = list_of<X>(1,1)(1,2)(1,3)(1,4);


Boost list run by bdawes at, gregod at, cpdaniel at, john at