$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [mpl] BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF
From: Eric Niebler (eric_at_[hidden])
Date: 2009-07-14 20:59:04
Hicham Mouline wrote:
> #include <iostream>
> #include <boost/mpl/has_xxx.hpp>
> #include <boost/mpl/bool.hpp>
>
> BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_xxx, xxx, false)
>
> struct test1 { int xxx; };
>
> using namespace boost::mpl;
> int main()
> {
> std::cout<< has_xxx<test1>::value <<std::endl;
> return 0;
> }
>
> The output is 0, while it should be 1, shouldn't it?
That macro generates a trait that looks for a nested *type* with the
specified name. In your case, xxx is a data member, not a type.
HTH,
-- Eric Niebler BoostPro Computing http://www.boostpro.com