Boost logo

Boost Users :

From: Michael Marcin (mmarcin_at_[hidden])
Date: 2006-08-09 15:10:03


What is the proper syntax for using lamda with with array?

i.e. how do I do something like

namespace lambda = ::boost::lambda;

boost::array< boost::array<int,2>, 4 > foo = {{ {-1,1}, {0,0}, {1,-1},
{2,-2} }};

std::for_each( foo.begin(), foo.end(), std::cout
    << lambda::constant( "first = " ) << lambda::_1[0] << ' '
    << lambda::constant( "second = " ) << lambda::_1[1] << '\n' );

Thanks


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