forked from boostorg/fusion
More constexpr and noexcept support.
Note 1: Forwarding functions are specified as a C++14 constexpr since std::forward is not a constexpr within C++11. Note 2: Though I'm not sure why it doesn't compile, some declarations are specified as a C++14 constexpr or non-constexpr. Note 3: Boost.Tuple adaptation and TR1-based tuple implementations are not constexpr.
This commit is contained in:
@ -31,7 +31,7 @@
|
||||
ctor_helper(rhs, is_base_of<vector, Sequence>()) \
|
||||
|
||||
#define BOOST_FUSION_VECTOR_CTOR_HELPER() \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
static vector_n const& \
|
||||
ctor_helper(vector const& rhs, mpl::true_) \
|
||||
{ \
|
||||
@ -39,7 +39,7 @@
|
||||
} \
|
||||
\
|
||||
template <typename T> \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
static T const& \
|
||||
ctor_helper(T const& rhs, mpl::false_) \
|
||||
{ \
|
||||
@ -102,20 +102,30 @@ namespace boost { namespace fusion
|
||||
typedef typename vector_n::category category;
|
||||
typedef typename vector_n::is_view is_view;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector()
|
||||
: vec() {}
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename U)>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector(vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, U)> const& rhs)
|
||||
: vec(rhs.vec) {}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector(vector const& rhs)
|
||||
: vec(rhs.vec) {}
|
||||
|
||||
template <typename Sequence>
|
||||
// XXX:
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
FUSION_HASH if !defined(BOOST_CLANG)
|
||||
BOOST_CONSTEXPR
|
||||
FUSION_HASH endif
|
||||
#else
|
||||
#if !defined(BOOST_CLANG)
|
||||
BOOST_CONSTEXPR
|
||||
#endif
|
||||
#endif
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
vector(Sequence const& rhs,
|
||||
typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
|
||||
@ -131,7 +141,7 @@ namespace boost { namespace fusion
|
||||
#include <boost/fusion/container/vector/detail/vector_forward_ctor.hpp>
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename U)>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector&
|
||||
operator=(vector<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, U)> const& rhs)
|
||||
{
|
||||
@ -140,7 +150,7 @@ namespace boost { namespace fusion
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector&
|
||||
operator=(T const& rhs)
|
||||
{
|
||||
@ -148,7 +158,7 @@ namespace boost { namespace fusion
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector&
|
||||
operator=(vector const& rhs)
|
||||
{
|
||||
@ -161,10 +171,11 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
|
||||
(defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector(vector&& rhs)
|
||||
: vec(std::forward<vector_n>(rhs.vec)) {}
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector&
|
||||
operator=(vector&& rhs)
|
||||
{
|
||||
@ -173,7 +184,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector&
|
||||
operator=(T&& rhs)
|
||||
{
|
||||
@ -186,7 +197,7 @@ FUSION_HASH endif
|
||||
#endif
|
||||
|
||||
template <int N>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename add_reference<
|
||||
typename mpl::at_c<types, N>::type
|
||||
>::type
|
||||
@ -196,7 +207,7 @@ FUSION_HASH endif
|
||||
}
|
||||
|
||||
template <int N>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename add_reference<
|
||||
typename add_const<
|
||||
typename mpl::at_c<types, N>::type
|
||||
@ -208,7 +219,7 @@ FUSION_HASH endif
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename add_reference<
|
||||
typename mpl::at<types, I>::type
|
||||
>::type
|
||||
@ -218,7 +229,7 @@ FUSION_HASH endif
|
||||
}
|
||||
|
||||
template<typename I>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename add_reference<
|
||||
typename add_const<
|
||||
typename mpl::at<types, I>::type
|
||||
|
Reference in New Issue
Block a user