Boost logo

Boost :

From: shunsuke (pstade.mb_at_[hidden])
Date: 2008-04-04 00:53:58


Giovanni Piero Deretta wrote:
>> BTW,
>> expression<T_curry2(F)>::type c = {{}};
>> is feasible.
>
> That would be very fine with me. But do you really need the double braces?

Well, after you and Eric's suggestion, and some thoughts,
I found that a newly introduced name can be `static_` only.
How about this? :

Adapting stateful functions with static-initialization:
     // already supported in review version
     result_of<T_curry2(F)>::type c = BOOST_EGG_CURRY2(&f);

Adapting runtime functions:
     // already supported, of course.
     result_of<T_curry2(F const &)>::type c = curry2(f);

Adapting stateless functions with static-initialization:
     // the newly proposed feature (macros unneeded.)
     static_< result_of<T_curry2(F)> >::type c = {{}};

     // BTW, this feature can be translated into the current review version:
     // static_< mpl::always<result_of<T_curry2(F)>::type> >::type c = BOOST_EGG_STATIC();

     // static_ is generic enough:
     static_< std::plus<int> >::type p = {{}};

The document will put much greater empahsis on the new feature
than the macro features, and it will be very simplified.

     // Also, I've added the secret support for return_of ;-)
     // See: http://tinyurl.com/32dbq8
     // After good experiences, (or if a portable workaround for round lambda syntax is found,)
     // this may be officially added.

BTW, I'm making all the braced-initializers of Function Builders be `{{}}`
so that those macros will be removed.
`{{}}` seems not so bad, because it is the same as egg::function<>'s.

Regards,

-- 
Shunsuke Sogame

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk