Boost logo

Boost Users :

Subject: Re: [Boost-users] [mini-review] Update of Boost.Assign (13th-19th of June)
From: er (erwann.rogard_at_[hidden])
Date: 2010-06-14 09:57:34


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);

In the proposed extension, cref_csv(1,2,3,4,5) or
cref_list_of(1)(2)(3)(4)(5) can do the same but keep references to the
arguments rather than copying them. Also, I have formalized the rules of
conversion in the doc:

https://svn.boost.org/svn/boost/sandbox/statistics/support/libs/assign/doc/index.html#concept-converter


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