
On Sat, Feb 20, 2010 at 1:21 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
AMDG
dilas dilas wrote:
Please, tell me if one can write nested lambda expressions like
" template<class Result, class Seq, class Elem> struct pairs: bm::fold<Seq, Result, bm::push_back<_1,bm::pair<Elem, _2 > > >{}; template<class Seq1, class Seq2> struct AllPairs: bm::fold<Seq1, bm::vector<>, pairs<_1,Seq2,_2> >{}; "
without using intermediate metafunctions.
This ought to work, since the placeholders in AllPairs will be expanded before pairs is ever invoked.
I do not know about Lambda, but I know that you can create sub-functors in phoenix just fine, it has specific constructs for that too. If you do not know, Boost.Phoenix is a complete replacement for Boost.Lambda, plus a lot more. http://www.boost.org/doc/libs/1_42_0/libs/spirit/phoenix/doc/html/index.html