Boost logo

Boost Users :

From: François Duranleau (duranlef_at_[hidden])
Date: 2006-12-11 12:10:31


On Fri, 24 Nov 2006, Mathias Gaunard wrote:

>> typedef boost::array<int, 4> word;
>>
>> std::vector vecOfWord;
>
> std::vector<word> vecOfWord;
>>
>> // perform some word insertion.
>
> You could do this, for example.
> word w = {1, 2, 3, 4};
>
> vecOfWord.push_back(w);

I have often encountered a similar situation, which led me to think that
maybe we should have the equivalent of make_tuple for boost::arrays, e.g.
make_array.

Example:

vecOfWord.push_back( make_array( 1 , 2 , 3 , 4 ) ) ;

-- 
François Duranleau
LIGUM, Université de Montréal

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net