merge new MPL version from 'mplbook' branch
[SVN r24874]
This commit is contained in:
1 parent
e2e70427cc
commit
1689c8ef83
1216 files changed
+89913
-36752
No files matched your search
@@ -0,0 +1,80 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(xxx)
|
||||
|
||||
struct a1 {};
|
||||
struct a2 { void xxx(); };
|
||||
struct a3 { int xxx; };
|
||||
struct a4 { static int xxx(); };
|
||||
|
||||
struct b1 { typedef int xxx; };
|
||||
struct b2 { struct xxx; };
|
||||
struct b3 { typedef int& xxx; };
|
||||
struct b4 { typedef int* xxx; };
|
||||
struct b5 { typedef int xxx[10]; };
|
||||
struct b6 { typedef void (*xxx)(); };
|
||||
struct b7 { typedef void (xxx)(); };
|
||||
|
||||
template< typename T > struct outer;
|
||||
template< typename T > struct inner { typedef typename T::type type; };
|
||||
|
||||
// agurt, 15/aug/04: make sure MWCW passes the test in presence of the following
|
||||
// template
|
||||
template< typename T > struct xxx;
|
||||
|
||||
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
MPL_ASSERT_NOT(( has_xxx<int> ));
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
MPL_ASSERT_NOT(( has_xxx<int&> ));
|
||||
MPL_ASSERT_NOT(( has_xxx<int*> ));
|
||||
MPL_ASSERT_NOT(( has_xxx<int[]> ));
|
||||
MPL_ASSERT_NOT(( has_xxx<int (*)()> ));
|
||||
|
||||
MPL_ASSERT_NOT(( has_xxx<a2> ));
|
||||
MPL_ASSERT_NOT(( has_xxx<a3> ));
|
||||
MPL_ASSERT_NOT(( has_xxx<a4> ));
|
||||
MPL_ASSERT_NOT(( has_xxx< enum_ > ));
|
||||
#endif
|
||||
MPL_ASSERT_NOT(( has_xxx<a1> ));
|
||||
MPL_ASSERT_NOT(( has_xxx< outer< inner<int> > > ));
|
||||
MPL_ASSERT_NOT(( has_xxx< incomplete > ));
|
||||
MPL_ASSERT_NOT(( has_xxx< abstract > ));
|
||||
MPL_ASSERT_NOT(( has_xxx< noncopyable > ));
|
||||
|
||||
MPL_ASSERT(( has_xxx<b1,true> ));
|
||||
MPL_ASSERT(( has_xxx<b2,true> ));
|
||||
MPL_ASSERT(( has_xxx<b3,true> ));
|
||||
MPL_ASSERT(( has_xxx<b4,true> ));
|
||||
MPL_ASSERT(( has_xxx<b5,true> ));
|
||||
MPL_ASSERT(( has_xxx<b6,true> ));
|
||||
MPL_ASSERT(( has_xxx<b7,true> ));
|
||||
|
||||
#if !defined(HAS_XXX_ASSERT)
|
||||
# define HAS_XXX_ASSERT(x) MPL_ASSERT(x)
|
||||
#endif
|
||||
|
||||
HAS_XXX_ASSERT(( has_xxx<b1> ));
|
||||
HAS_XXX_ASSERT(( has_xxx<b2> ));
|
||||
HAS_XXX_ASSERT(( has_xxx<b3> ));
|
||||
HAS_XXX_ASSERT(( has_xxx<b4> ));
|
||||
HAS_XXX_ASSERT(( has_xxx<b5> ));
|
||||
HAS_XXX_ASSERT(( has_xxx<b6> ));
|
||||
HAS_XXX_ASSERT(( has_xxx<b7> ));
|
||||
}
|
||||
Reference in new issue
Block a user