Added notes for CWG 496 and CWG 2094

rename macros to be more descriptive
This commit is contained in:
Kohei Takahashi
2018-05-10 00:55:07 +09:00
parent 5c3600d277
commit 37e4fab58b
5 changed files with 155 additions and 140 deletions

View File

@ -9,17 +9,27 @@
#include <boost/fusion/support/detail/is_trivially_copyable.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/static_assert.hpp>
#ifndef BOOST_FUSION_DETAIL_VOLATILE_SCALAR_IS_NON_TRIVIALLY_COPYABLE
# define BOOST_FUSION_ASSERT_WA BOOST_MPL_ASSERT
#if defined(BOOST_FUSION_DETAIL_VOLATILE_SCALAR_IS_NON_TRIVIALLY_COPYABLE)
# define BOOST_FUSION_ASSERT_CWG496_SCALAR BOOST_MPL_ASSERT_NOT
#elif defined(BOOST_FUSION_IS_TRIVIALLY_COPYABLE)
# define BOOST_FUSION_ASSERT_CWG496_SCALAR_I(...) BOOST_STATIC_ASSERT((__VA_ARGS__::value) == BOOST_FUSION_IS_TRIVIALLY_COPYABLE(int volatile))
# define BOOST_FUSION_ASSERT_CWG496_SCALAR(pred) BOOST_FUSION_ASSERT_CWG496_SCALAR_I pred
#else
# define BOOST_FUSION_ASSERT_WA BOOST_MPL_ASSERT_NOT
# define BOOST_FUSION_ASSERT_CWG496_SCALAR BOOST_MPL_ASSERT
#endif
#ifdef BOOST_FUSION_DETAIL_IS_TRIVIALLY_COPYABLE_CONFORMING
# define BOOST_FUSION_ASSERT_FALLBACK BOOST_MPL_ASSERT
#if defined(BOOST_FUSION_IS_TRIVIALLY_COPYABLE)
# define BOOST_FUSION_ASSERT_CWG496 BOOST_MPL_ASSERT
# define BOOST_FUSION_ASSERT_CWG2094_I(...) BOOST_STATIC_ASSERT((__VA_ARGS__::value) == BOOST_FUSION_IS_TRIVIALLY_COPYABLE(trivial volatile))
# define BOOST_FUSION_ASSERT_CWG2094(pred) BOOST_FUSION_ASSERT_CWG2094_I pred
#elif defined(BOOST_FUSION_DETAIL_IS_TRIVIALLY_COPYABLE_CONFORMING)
# define BOOST_FUSION_ASSERT_CWG496 BOOST_MPL_ASSERT
# define BOOST_FUSION_ASSERT_CWG2094 BOOST_MPL_ASSERT
#else
# define BOOST_FUSION_ASSERT_FALLBACK(cond) BOOST_MPL_ASSERT((boost::mpl::true_))
# define BOOST_FUSION_ASSERT_CWG496(pred) struct skip_assertion
# define BOOST_FUSION_ASSERT_CWG2094(pred) struct skip_assertion
#endif