Boost logo

Boost :

Subject: Re: [boost] Proposal: boost::make_array()
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2013-01-13 15:46:12


On Jan 13, 2013, at 12:42 PM, Marshall Clow <mclow.lists_at_[hidden]> wrote:

> On Jan 12, 2013, at 5:43 PM, Yves Bailly <yves.bailly_at_[hidden]> wrote:
>
>> Greetings Kyle,
>>
>> On 01/12/2013 05:45 PM, Kyle Lutz wrote:
>>> I'd like to propose a new function for the Boost Array library named
>>> make_array(). The function constructs a fixed size array given N arguments
>>> and is similar to the make_pair() and make_tuple() functions.
>>> [...]
>>> The code is available on github at https://github.com/kylelutz/make_array
>>
>> Sorry if it's a genuine question... But in the case of C++11, wouldn't it be
>> simpler to use an expansion instead of the "push_array" function? Something
>> like this:
>
> In C++11, you can just use an initializer list:
>
> boost::array<int, 5> {{ 0, 1, 2, 3, 4 }};

Sorry. This works in both 03 and 11 (tried with gcc and clang):

        boost::array<int, 5> arr = { 0, 1, 2, 3, 4, };

(aggregate initialization)

-- Marshall

Marshall Clow Idio Software <mailto:mclow.lists_at_[hidden]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki


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