mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-01 05:44:37 +02:00
Merge branch 'develop'
This commit is contained in:
@@ -77,7 +77,7 @@ struct AUX_WRAPPER_NAME
|
||||
// functions that return objects of both arithmetic ('int', 'long',
|
||||
// 'double', etc.) and wrapped integral types (for an example, see
|
||||
// "mpl/example/power.cpp")
|
||||
operator AUX_WRAPPER_VALUE_TYPE() const { return static_cast<AUX_WRAPPER_VALUE_TYPE>(this->value); }
|
||||
BOOST_CONSTEXPR operator AUX_WRAPPER_VALUE_TYPE() const { return static_cast<AUX_WRAPPER_VALUE_TYPE>(this->value); }
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
|
||||
|
@@ -26,7 +26,7 @@ template< bool C_ > struct bool_
|
||||
typedef integral_c_tag tag;
|
||||
typedef bool_ type;
|
||||
typedef bool value_type;
|
||||
operator bool() const { return this->value; }
|
||||
BOOST_CONSTEXPR operator bool() const { return this->value; }
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/detail/endian.hpp>
|
||||
#include <boost/predef/other/endian.h>
|
||||
#include <boost/mpl/limits/string.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/char.hpp>
|
||||
@@ -59,7 +59,7 @@ namespace boost { namespace mpl
|
||||
#define BOOST_MPL_MULTICHAR_LENGTH(c) \
|
||||
(std::size_t)((c<CHAR_MIN) ? 4 : ((c>0xffffff)+(c>0xffff)+(c>0xff)+1))
|
||||
|
||||
#if defined(BOOST_LITTLE_ENDIAN) && defined(__SUNPRO_CC)
|
||||
#if defined(BOOST_ENDIAN_LITTLE_BYTE) && defined(__SUNPRO_CC)
|
||||
|
||||
#define BOOST_MPL_MULTICHAR_AT(c,i) \
|
||||
(char)(0xff&((unsigned)(c)>>(8*(std::size_t)(i))))
|
||||
|
@@ -16,11 +16,18 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#if defined(BOOST_NO_CXX11_CONSTEXPR)
|
||||
#define CONSTEXPR_BOOL_TEST(c)
|
||||
#else
|
||||
#define CONSTEXPR_BOOL_TEST(c) { static_assert(bool_<c>() == c, "Constexpr for bool_ failed"); }
|
||||
#endif
|
||||
|
||||
#define BOOL_TEST(c) \
|
||||
{ MPL_ASSERT(( is_same< bool_<c>::value_type, bool > )); } \
|
||||
{ MPL_ASSERT(( is_same< bool_<c>, c##_ > )); } \
|
||||
{ MPL_ASSERT(( is_same< bool_<c>::type, bool_<c> > )); } \
|
||||
{ MPL_ASSERT_RELATION( bool_<c>::value, ==, c ); } \
|
||||
CONSTEXPR_BOOL_TEST(c) \
|
||||
BOOST_TEST( bool_<c>() == c ); \
|
||||
/**/
|
||||
|
||||
|
@@ -28,6 +28,12 @@
|
||||
/**/
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_CONSTEXPR)
|
||||
#define CONSTEXPR_INTEGRAL_TEST(T, i)
|
||||
#else
|
||||
#define CONSTEXPR_INTEGRAL_TEST(T, i) { static_assert(T() == i, "Constexpr for integral constant failed"); }
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
|
||||
// agurt 20/nov/06: see http://article.gmane.org/gmane.comp.lib.boost.devel/151065
|
||||
#define INTEGRAL_WRAPPER_TEST(unused1, i, T) \
|
||||
@@ -39,6 +45,7 @@
|
||||
{ MPL_ASSERT(( is_same< next< borland_tested_type >::type, WRAPPER(T,i+1) > )); } \
|
||||
{ MPL_ASSERT(( is_same< prior< borland_tested_type >::type, WRAPPER(T,i-1) > )); } \
|
||||
{ MPL_ASSERT_RELATION( (borland_tested_type::value), ==, i ); } \
|
||||
CONSTEXPR_INTEGRAL_TEST(borland_tested_type, i) \
|
||||
INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
|
||||
} \
|
||||
/**/
|
||||
@@ -49,6 +56,7 @@
|
||||
{ MPL_ASSERT(( is_same< next< WRAPPER(T,i) >::type, WRAPPER(T,i+1) > )); } \
|
||||
{ MPL_ASSERT(( is_same< prior< WRAPPER(T,i) >::type, WRAPPER(T,i-1) > )); } \
|
||||
{ MPL_ASSERT_RELATION( (WRAPPER(T,i)::value), ==, i ); } \
|
||||
CONSTEXPR_INTEGRAL_TEST(WRAPPER(T,i), i) \
|
||||
INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
|
||||
/**/
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user