David Abrahams wrote:
> Second thing: you can save yourself lots of typenames by taking
> advantage of the way MPL lets you pass an uninstantiated metafunction,
> without getting its nested ::type member, wherever a bool_c<...> is
> expected:

Uhm, that's not exactly correct. I would re-formulate it along these lines:

To reduce the notational overhead imposed by the specifics of the
compile-time domain, many of MPL metafunctions, when fully-curried (provided
with all arguments), directly support the interface of the Integral Constant
concept:

  BOOST_STATIC_ASSERT(not_equal_to< int_c<5>, int_c<0> >::type::value); //
OK, ordinary function invocation
  BOOST_STATIC_ASSERT(not_equal_to< int_c<5>, int_c<0> >::value); // also
OK!

This property often allows you to simplify your compile-time conditions:

> 
>         apply_if< 
>              typename equal_to<N, integral_c<N::value_type, 0> >::type
>              , ...
> 
> can be written:
> 
>         apply_if< 
>              equal_to<N, integral_c<N::value_type, 0> >
>              , ...
> 

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

Reply via email to