Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2004-10-12 22:23:19


On 09/13/2004 12:37 PM, Robert Ramey wrote:
> Would someone have a fit if something like this were added to boost/mpl ?
[snip]
> // apply_if is deprecated. Use eval_if instead. This is only included
> // to support older code like spirit 1.6
>
> #ifndef BOOST_MPL_APPLY_IF_HPP_INCLUDED
> #define BOOST_MPL_APPLY_IF_HPP_INCLUDED
>
> #include "boost/mpl/eval_if.hpp"
>
> namespace boost {
> namespace mpl {
>
> template<
> typename C
> , typename F1
> , typename F2
> >
> struct apply_if
> {
> typedef BOOST_DEDUCED_TYPENAME eval_if<C,F1,F2>::type type;
> };
>

I tried a global replace of apply_if with eval_if; however, I got:
<--------------------

intel-linux.compile.c++
../../../../bin.v2/lje/libs/managed_ptr/test/intel-linux/debug/smart_ptr_test.o
../../../boost/managed_ptr/smart_ptr.hpp(204): error: class
"boost::mpl::eval_if<boost::mpl::bool_<false>::type,
boost::mpl::identity<boost::ref_counted<boost::mpl::_>>,
boost::detail::get_policy<boost::mpl::list<boost::managed_ptr::refcycle_counted_curry_prox_visitor<boost::managed_ptr::refcycle_prox_visitor_abs::this_type>::owner_refptr<boost::mpl::_>,
boost::empty_policy, boost::empty_policy, boost::empty_policy,
boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na,
boost::mpl::na,
           boost::mpl::na, boost::mpl::na, boost::mpl::na,
boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na,
boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na>,
boost::ownership_policy_tag, boost::ref_counted<boost::mpl::_>>::iter_>"
has no member "type"
>::type type;
                  ^
           detected during:
             instantiation of class "boost::detail::get_policy<Sequence,
Category, Default> [with
Sequence=boost::mpl::list<boost::managed_ptr::refcycle_counted_curry_prox_visitor<boost::managed_ptr::refcycle_prox_visitor_abs::this_type>::owner_refptr<boost::mpl::_>,
boost::empty_policy, boost::empty_policy, boost::empty_policy,
boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na,
boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na,
boost::mpl::na, boost::mpl::na,
                       boost::mpl::na, boost::mpl::na, boost::mpl::na,
boost::mpl::na, boost::mpl::na, boost::mpl::na>,
Category=boost::ownership_policy_tag,
Default=boost::ref_counted<boost::mpl::_>]" at line 225

>----------------

I've searched mail archives for apply_if and eval_if and looked at:

   http://www.boost.org/libs/mpl

as directed by comments in eval_if.hpp; however, none were any help
except the one I'm replying to.

How does one replace apply_if with eval_if to avoid the above error
message.

TIA.

Regards,
Larry


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