
14 Jun
2010
14 Jun
'10
7:57 a.m.
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/i...