Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2005-07-28 01:01:02


Brian Braatz writes:
> Either something strange is happening with arg<> and transform or I did
> not write this code correctly. ( :) )

The latter :).

[...]

> typedef mpl::transform
> <
> vec_t,
> mpl::if_
> <
> boost::is_same<mpl::_1, A >,
> YES< mpl::_1 >::type,
                       ^^^^^^
> NO< mpl::_1 >::type
                      ^^^^^^
> >::type
    ^^^^^^^
>>::type result;

By requesting '::type' on a metafunction you are immediately
instantiating it with the placeholder argument(s), which is not what
you want. Try

    typedef mpl::transform<
          vec_t
        , mpl::if_<
              , boost::is_same<mpl::_1, A>
              , YES< mpl::_1 >
              , NO< mpl::_1 >
>
>::type result;

instead.

HTH,

-- 
Aleksey Gurtovoy
MetaCommunications Engineering

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