
19 Jun
2010
19 Jun
'10
12:22 a.m.
list_of(x).repeat(n,y) ---> NA
A compile time analog, for what it's worth, would work like this: int a = 4; BOOST_AUTO( tmp, repeat<3>(a) ); // internally calls ref_csv(a,a,a) BOOST_ASSERT( tmp[0] == 4 ); BOOST_ASSERT( tmp[1] == 4 ); BOOST_ASSERT( tmp[2] == 4 ); BOOST_ASSERT( tmp.size() == 3 ); tmp[0] = 1; BOOST_ASSERT( a == 1 ); tmp[1] = 2; BOOST_ASSERT( a == 2 ); tmp[2] = 3; BOOST_ASSERT( a == 3 ); It would be fairly to implement. I started here: http://svn.boost.org/svn/boost/sandbox/statistics/support/boost/assign/auto_...