Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2008-02-21 07:56:54


On Thu, Feb 21, 2008 at 12:52 PM, John Maddock <john_at_[hidden]>
wrote:

> Ovanes Markarian wrote:
> ...
> As I understand it, this traits class is intended to identify nested types
> only - certainly that's the only use case I've used it for.
>
> HTH, John.
>
>
Ohhh stupid me!!! I have overseen in the docs example the ASSERT_!!!NOT!!!
and thought this assertion is true.

BOOST_MPL_HAS_XXX_TRAIT_DEF(has_xxx)

struct test1 {};
struct test2 { void xxx(); };
struct test3 { int xxx; };
struct test4 { static int xxx(); };
struct test5 { template< typename T > struct xxx {}; };
struct test6 { typedef int xxx; };
struct test7 { struct xxx; };
struct test8 { typedef void (*xxx)(); };
struct test9 { typedef void (xxx)(); };

BOOST_MPL_ASSERT_NOT(( has_xxx<test1> ));
BOOST_MPL_ASSERT_NOT(( has_xxx<test2> ));
BOOST_MPL_ASSERT_NOT(( has_xxx<test3> ));
BOOST_MPL_ASSERT_NOT(( has_xxx<test4> ));
BOOST_MPL_ASSERT_NOT(( has_xxx<test5> ));

...

Many thanks for your reply!

Ovanes



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net