Boost logo

Boost Users :

Subject: Re: [Boost-users] [mini-review] Update of Boost.Assign (13th-19th of June)
From: Christopher Jefferson (chris_at_[hidden])
Date: 2010-06-14 10:43:33


On 14 Jun 2010, at 14:57, er wrote:

> Christopher, thanks for inquiring.
>
>> and:
>> make<std::vector>(1,2,3,4,5); // Makes a std::vector<int> containing 1,2,3,4,5
>> make_list(1,2,3,4,5); // Makes a list which can be assigned to any standard container, filling it with 1,2,3,4,5.
>
> Something similar is already possible before the proposed extension e.g.
>
> list_of(1)(2)(3)(4)(5).convert_to_container<std::vector<int> >();
> std::vector<int> vec = list_of(1)(2)(3)(4)(5);

Certainly this doesn't add anything new. Personally I prefer the look of (1,2,3,4,5) over (1)(2)(3)(4)(5), now that the core language supports it efficiently.

Chris


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