BOOST_NO_MPL_AUX_HAS_XXX -> BOOST_MPL_NO_AUX_HAS_XXX
[SVN r18974]
This commit is contained in:
1 parent
bc30ed2002
commit
b8a4930412
8 files changed
+98
-85
No files matched your search
+37
-28
@@ -1,9 +1,8 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost mpl/test/aux_/has_xxx.cpp source file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2000-02
|
||||
|
||||
// + file: libs/mpl/test/aux_/has_xxx.cpp
|
||||
// + last modified: 09/jun/03
|
||||
|
||||
// Copyright (c) 2000-03
|
||||
// Aleksey Gurtovoy
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
@@ -13,42 +12,52 @@
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
#include "boost/mpl/aux_/has_xxx.hpp"
|
||||
#include "boost/mpl/aux_/config/workaround.hpp"
|
||||
#include "boost/static_assert.hpp"
|
||||
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(xxx_type)
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(xxx)
|
||||
|
||||
struct a1;
|
||||
struct a2 {};
|
||||
struct a3 { typedef int xxx_type; };
|
||||
struct a4 { struct xxx_type; };
|
||||
struct a5 { typedef int& xxx_type; };
|
||||
struct a6 { typedef int* xxx_type; };
|
||||
struct a7 { typedef int xxx_type[10]; };
|
||||
struct a8 { typedef void (*xxx_type)(); };
|
||||
struct a9 { typedef void (xxx_type)(); };
|
||||
struct a3 { void xxx(); };
|
||||
struct a4 { int xxx; };
|
||||
struct a5 { 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)(); };
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
BOOST_STATIC_ASSERT(!has_xxx_type<int&>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx_type<int*>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx_type<int[]>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx_type<int (*)()>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx<int&>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx<int*>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx<int[]>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx<int (*)()>::value);
|
||||
#endif
|
||||
BOOST_STATIC_ASSERT(!has_xxx<int>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx<a1>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx<a2>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx<a3>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx<a4>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx<a5>::value);
|
||||
|
||||
BOOST_STATIC_ASSERT(!has_xxx_type<int>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx_type<a1>::value);
|
||||
BOOST_STATIC_ASSERT(!has_xxx_type<a2>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx_type<a3>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx_type<a4>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx_type<a5>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx_type<a6>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx_type<a7>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx_type<a8>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx_type<a9>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx<b1>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx<b2>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx<b3>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx<b4>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx<b5>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx<b6>::value);
|
||||
BOOST_STATIC_ASSERT(has_xxx<b7>::value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -32,7 +32,7 @@ struct a9 { typedef void (xxx_type)(); };
|
||||
|
||||
//
|
||||
// This file tests that we have the right value for
|
||||
// BOOST_NO_MPL_AUX_HAS_XXX, and that has_xxx doesn't just fail to
|
||||
// BOOST_MPL_NO_AUX_HAS_XXX, and that has_xxx doesn't just fail to
|
||||
// compile arbitrarily. Could be used as part of the config tests.
|
||||
//
|
||||
|
||||
@@ -40,7 +40,7 @@ struct a9 { typedef void (xxx_type)(); };
|
||||
#undef TRUE
|
||||
#define FALSE false
|
||||
|
||||
#ifdef BOOST_NO_MPL_AUX_HAS_XXX
|
||||
#ifdef BOOST_MPL_NO_AUX_HAS_XXX
|
||||
# define TRUE FALSE
|
||||
#else
|
||||
# define TRUE true
|
||||
|
||||
Reference in new issue
Block a user