mirror of
https://github.com/boostorg/static_assert.git
synced 2025-07-18 15:12:08 +02:00
Merge changes from Trunk.
[SVN r81828]
This commit is contained in:
@ -36,7 +36,7 @@ the static assertion will be evaluated at the time the template is instantiated;
|
|||||||
this is particularly useful for validating template parameters.
|
this is particularly useful for validating template parameters.
|
||||||
|
|
||||||
If the C++0x `static_assert` feature is available, both macros will use it.
|
If the C++0x `static_assert` feature is available, both macros will use it.
|
||||||
For `BOOST_STATIC_ASSERT(x)`, the error message with be a stringized version of `x`.
|
For `BOOST_STATIC_ASSERT(x)`, the error message will be a stringized version of `x`.
|
||||||
For `BOOST_STATIC_ASSERT_MSG(x, msg)`, the error message will be the `msg` string.
|
For `BOOST_STATIC_ASSERT_MSG(x, msg)`, the error message will be the `msg` string.
|
||||||
|
|
||||||
If the C++0x `static_assert` feature is not available, `BOOST_STATIC_ASSERT_MSG(x, msg)`
|
If the C++0x `static_assert` feature is not available, `BOOST_STATIC_ASSERT_MSG(x, msg)`
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
#ifndef BOOST_NO_STATIC_ASSERT
|
#ifndef BOOST_NO_CXX11_STATIC_ASSERT
|
||||||
# define BOOST_STATIC_ASSERT_MSG( B, Msg ) static_assert(B, Msg)
|
# define BOOST_STATIC_ASSERT_MSG( B, Msg ) static_assert(B, Msg)
|
||||||
#else
|
#else
|
||||||
# define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
|
# define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
|
||||||
@ -44,7 +44,7 @@
|
|||||||
# define BOOST_STATIC_ASSERT_BOOL_CAST(x) (bool)(x)
|
# define BOOST_STATIC_ASSERT_BOOL_CAST(x) (bool)(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BOOST_NO_STATIC_ASSERT
|
#ifndef BOOST_NO_CXX11_STATIC_ASSERT
|
||||||
# define BOOST_STATIC_ASSERT( B ) static_assert(B, #B)
|
# define BOOST_STATIC_ASSERT( B ) static_assert(B, #B)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ template<int x> struct static_assert_test{};
|
|||||||
enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
|
enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
|
||||||
= sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) }
|
= sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) }
|
||||||
#endif
|
#endif
|
||||||
#endif // defined(BOOST_NO_STATIC_ASSERT)
|
#endif // defined(BOOST_NO_CXX11_STATIC_ASSERT)
|
||||||
|
|
||||||
#endif // BOOST_STATIC_ASSERT_HPP
|
#endif // BOOST_STATIC_ASSERT_HPP
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user