Boost logo

Boost :

Subject: Re: [boost] [Boost.Assign] list_of::range without an initial (single) element?
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2010-06-15 13:13:09


er skrev:
> Michael McNeil Forbes wrote:
>> What is the recommended way of initializing an array from a
>> concatenation of other arrays?
>>
>> list_of::range looks right and I would like to use something like:
>>
>> array<int, 2> a = { 1, 2 };
>> array<int, 2> b = { 3, 4 };
>> array<int, 4> c = list_of<int>().range(a).range(b);
>>
>> However, list_of<int>() inserts a default value (so that
>> list_of<int>().range(a).range(b) == {0,1,2,3,4}).

Maybe we should add

    empty_list_of<int>()

? It's quite trivial to add.

-Thorsten


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