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:
Kohei Takahashi
2015-03-03 02:21:02 +09:00
parent d7c918e36f
commit 2114bfca6c
280 changed files with 1107 additions and 935 deletions

View File

@ -38,7 +38,7 @@ BOOST_FUSION_BARRIER_BEGIN
};
template <typename Iterator>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static typename apply<Iterator>::type
call(Iterator)
{
@ -124,7 +124,7 @@ BOOST_FUSION_BARRIER_END
};
template <typename Iterator>
BOOST_FUSION_GPU_ENABLED
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static typename apply<Iterator>::type
call(Iterator const& i0)
{

View File

@ -33,7 +33,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::as_deque<Sequence>::type
as_deque(Sequence& seq)
{
@ -42,7 +42,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::as_deque<Sequence const>::type
as_deque(Sequence const& seq)
{

View File

@ -79,34 +79,34 @@ namespace boost { namespace fusion {
#include <boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque()
{}
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit deque(typename detail::call_param<T0>::type t0)
: base(t0, detail::nil_keyed_element())
{}
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit deque(deque const& rhs)
: base(rhs)
{}
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq)
: base(seq)
{}
template<typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0)
: base(base::from_iterator(fusion::begin(seq)))
{}
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
BOOST_FUSION_GPU_ENABLED
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque&
operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& rhs)
{
@ -115,7 +115,7 @@ namespace boost { namespace fusion {
}
template <typename T>
BOOST_FUSION_GPU_ENABLED
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque&
operator=(T const& rhs)
{
@ -129,23 +129,23 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
(defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
template <typename T0_>
BOOST_FUSION_GPU_ENABLED
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit deque(T0_&& t0
, typename enable_if<is_convertible<T0_, T0> >::type* /*dummy*/ = 0
)
: base(BOOST_FUSION_FWD_ELEM(T0_, t0), detail::nil_keyed_element())
{}
BOOST_FUSION_GPU_ENABLED
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit deque(deque&& rhs)
: base(std::forward<deque>(rhs))
{}
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
BOOST_FUSION_GPU_ENABLED
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>&& seq)
: base(std::forward<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>>(seq))
{}
template <typename T>
BOOST_FUSION_GPU_ENABLED
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque&
operator=(T&& rhs)
{
@ -170,16 +170,16 @@ FUSION_HASH endif
typedef mpl::false_ is_view;
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque(Sequence const&,
typename enable_if<
mpl::and_<
traits::is_sequence<Sequence>
, result_of::empty<Sequence> > >::type* /*dummy*/ = 0)
, result_of::empty<Sequence> > >::type* /*dummy*/ = 0) BOOST_NOEXCEPT
{}
BOOST_FUSION_GPU_ENABLED
deque() {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque() BOOST_NOEXCEPT {}
};
}}

View File

@ -35,7 +35,7 @@ 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_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param<T, >::type t))
: base(detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(N, T)>::construct(BOOST_PP_ENUM_PARAMS(N, t)))
{}
@ -49,13 +49,13 @@ 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_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& t))
: base(detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(N, T)>::construct(BOOST_PP_ENUM_PARAMS(N, t)))
{}
template <BOOST_PP_ENUM_PARAMS(N, typename T_)>
BOOST_FUSION_GPU_ENABLED
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T_, && t))
: base(detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(N, T)>::
forward_(BOOST_PP_ENUM(N, FUSION_DEQUE_FORWARD_CTOR_FORWARD, _)))

View File

@ -68,13 +68,13 @@ namespace boost { namespace fusion { namespace detail
{
typedef nil_keyed_element type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type construct()
{
return type();
}
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type forward_()
{
return type();

View File

@ -34,7 +34,7 @@
#define N BOOST_PP_ITERATION()
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type construct(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param<T, >::type t))
{
return type(t0,
@ -52,7 +52,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
(defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
template <BOOST_PP_ENUM_PARAMS(N, typename T_)>
BOOST_FUSION_GPU_ENABLED
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type forward_(BOOST_PP_ENUM_BINARY_PARAMS(N, T_, && t))
{
return type(BOOST_FUSION_FWD_ELEM(T_0, t0),