> -----Original Message-----
> From: Aleksey Gurtovoy [mailto:agurtovoy@;meta-comm.com]
> Sent: Friday, November 15, 2002 7:52 AM
> To: 'Boost mailing list'
> Subject: RE: [boost] MPL lambda
> 
> 
> Rozental, Gennadiy wrote:
> > I am having hard time grasping how this %#$% lambda facility 
> > is working. 
> 
> I hope you mean "what it does/how to use it" as opposite to 
> "how it does
> what it does" ;).

In fact it is second ;-)

>     // numbered placeholders semantics
>     plus<_1, int_c<5> > == bind<meta_fun2<plus>,_1,int_c<5> >
>     plus< int_c<5>,_1 > == bind<meta_fun2<plus>,int_c<5>,_1 >
>     plus< int_c<5>,_2 > == bind<meta_fun2<plus>,int_c<5>,_2 >
>     plus<_1,_2> == bind<meta_fun2<plus>,_1,_2>
>     plus<_2,_1> == bind<meta_fun2<plus>,_2,_1>
>     
>     logical_or< is_same<_1,int>, is_same<_1,long> >
>         = bind< meta_fun2<logical_or>
>             , bind< meta_fun2<is_same>,_1,int >
>             , bind< meta_fun2<is_same>,_1,long >
>             >
> 
>     is_same< _1, add_pointer<_2> >
>         == bind< meta_fun2<is_same>
>             , _1
>             , bind< meta_fun1<add_pointer>, _2 >
>             >

It would help if you start with what meta_fun[n] are, cause they are not
covered in docs. Also if I understand correctly it require template template
parameters. How then it works for MSVC6.5?

> 
>     // unnamed placeholder semantics
>     plus< _,int_c<5> > == plus<_1, int_c<5> >
>     plus< int_c<5>,_ > == plus< int_c<5>,_1 >
>     ??? == plus< int_c<5>,_2 > // can't be built using 
> unnamed notation
>     plus<_,_> == plus<_1,_2> 
>     ??? == plus<_2,_1> 
> 
>     logical_or< is_same<_,int>, is_same<_,long> >
>         = logical_or< is_same<_1,int>, is_same<_1,long> >
> 
>     is_same< _, add_pointer<_> > != is_same< _1, 
> add_pointer<_2> > // !!!
>     is_same< _, add_pointer<_> >
>         == bind< meta_fun2<is_same>
>             , _1
>             , bind< meta_fun1<add_pointer>, _1 > // !!!
>             >
> 
So the _ placeholder is substituted with appropriated numbered one based on
position in expression. How did you managed to achieve this?

Gennadiy.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to