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:
@@ -27,7 +27,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
void get();
|
||||
|
||||
template<typename It>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static nil_keyed_element
|
||||
from_iterator(It const&)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
using Rest::get;
|
||||
|
||||
template <typename It>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static keyed_element
|
||||
from_iterator(It const& it)
|
||||
{
|
||||
@@ -51,13 +51,13 @@ namespace boost { namespace fusion { namespace detail
|
||||
*it, base::from_iterator(fusion::next(it)));
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(keyed_element const& rhs)
|
||||
: Rest(rhs.get_base()), value_(rhs.value_)
|
||||
{}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(keyed_element&& rhs)
|
||||
: Rest(BOOST_FUSION_FWD_ELEM(Rest, rhs.forward_base()))
|
||||
, value_(BOOST_FUSION_FWD_ELEM(Value, rhs.value_))
|
||||
@@ -65,7 +65,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
#endif
|
||||
|
||||
template <typename U, typename Rst>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(keyed_element<Key, U, Rst> const& rhs)
|
||||
: Rest(rhs.get_base()), value_(rhs.value_)
|
||||
{}
|
||||
@@ -73,39 +73,39 @@ namespace boost { namespace fusion { namespace detail
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#endif
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
Rest& get_base()
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
Rest& get_base() BOOST_NOEXCEPT
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
Rest const& get_base() const
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
Rest const& get_base() const BOOST_NOEXCEPT
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
Rest&& forward_base()
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
Rest&& forward_base() BOOST_NOEXCEPT
|
||||
{
|
||||
return BOOST_FUSION_FWD_ELEM(Rest, *static_cast<Rest*>(this));
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename cref_result<Value>::type get(Key) const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename ref_result<Value>::type get(Key)
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(
|
||||
typename detail::call_param<Value>::type value
|
||||
, Rest const& rest)
|
||||
@@ -113,20 +113,20 @@ namespace boost { namespace fusion { namespace detail
|
||||
{}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(Value&& value, Rest&& rest)
|
||||
: Rest(BOOST_FUSION_FWD_ELEM(Rest, rest))
|
||||
, value_(BOOST_FUSION_FWD_ELEM(Value, value))
|
||||
{}
|
||||
#endif
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element()
|
||||
: Rest(), value_()
|
||||
{}
|
||||
|
||||
template<typename U, typename Rst>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element& operator=(keyed_element<Key, U, Rst> const& rhs)
|
||||
{
|
||||
base::operator=(static_cast<Rst const&>(rhs)); // cast for msvc-7.1
|
||||
@@ -134,7 +134,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element& operator=(keyed_element const& rhs)
|
||||
{
|
||||
base::operator=(rhs);
|
||||
@@ -143,7 +143,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element& operator=(keyed_element&& rhs)
|
||||
{
|
||||
base::operator=(std::forward<keyed_element>(rhs));
|
||||
|
Reference in New Issue
Block a user