summaryrefslogtreecommitdiff
path: root/boost/fusion/support
diff options
context:
space:
mode:
Diffstat (limited to 'boost/fusion/support')
-rw-r--r--boost/fusion/support/as_const.hpp7
-rw-r--r--boost/fusion/support/config.hpp74
-rw-r--r--boost/fusion/support/deduce.hpp19
-rw-r--r--boost/fusion/support/detail/as_fusion_element.hpp12
-rw-r--r--boost/fusion/support/detail/enabler.hpp18
-rw-r--r--boost/fusion/support/detail/result_of.hpp53
-rw-r--r--boost/fusion/support/detail/segmented_fold_until_impl.hpp24
-rw-r--r--boost/fusion/support/is_sequence.hpp4
-rw-r--r--boost/fusion/support/iterator_base.hpp9
-rw-r--r--boost/fusion/support/pair.hpp36
-rw-r--r--boost/fusion/support/segmented_fold_until.hpp12
-rw-r--r--boost/fusion/support/sequence_base.hpp13
-rw-r--r--boost/fusion/support/unused.hpp36
13 files changed, 250 insertions, 67 deletions
diff --git a/boost/fusion/support/as_const.hpp b/boost/fusion/support/as_const.hpp
index ed535970c3..04d5bfcc14 100644
--- a/boost/fusion/support/as_const.hpp
+++ b/boost/fusion/support/as_const.hpp
@@ -7,6 +7,9 @@
#ifndef BOOST_FUSION_SUPPORT_AS_CONST_HPP
#define BOOST_FUSION_SUPPORT_AS_CONST_HPP
+#include <boost/config.hpp>
+#include <boost/fusion/support/config.hpp>
+
namespace boost { namespace fusion { namespace extension
{
// A customization point that allows certain wrappers around
@@ -16,8 +19,8 @@ namespace boost { namespace fusion { namespace extension
// such contexts with calls to this function. Users can
// specialize this function for their own wrappers.
template <typename T>
- BOOST_FUSION_GPU_ENABLED
- const T& as_const(const T& obj)
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ inline const T& as_const(const T& obj) BOOST_NOEXCEPT
{
return obj;
}
diff --git a/boost/fusion/support/config.hpp b/boost/fusion/support/config.hpp
index 16e38f9587..10dc29df54 100644
--- a/boost/fusion/support/config.hpp
+++ b/boost/fusion/support/config.hpp
@@ -1,5 +1,6 @@
/*=============================================================================
Copyright (c) 2014 Eric Niebler
+ Copyright (c) 2014 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -8,9 +9,82 @@
#define FUSION_SUPPORT_CONFIG_01092014_1718
#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
#ifndef BOOST_FUSION_GPU_ENABLED
#define BOOST_FUSION_GPU_ENABLED BOOST_GPU_ENABLED
#endif
+// Enclose with inline namespace because unqualified lookup of GCC < 4.5 is broken.
+//
+// namespace detail {
+// struct foo;
+// struct X { };
+// }
+//
+// template <typename T> void foo(T) { }
+//
+// int main()
+// {
+// foo(detail::X());
+// // prog.cc: In function 'int main()':
+// // prog.cc:2: error: 'struct detail::foo' is not a function,
+// // prog.cc:6: error: conflict with 'template<class T> void foo(T)'
+// // prog.cc:10: error: in call to 'foo'
+// }
+namespace boost { namespace fusion { namespace detail
+{
+ namespace barrier { }
+ using namespace barrier;
+}}}
+#define BOOST_FUSION_BARRIER_BEGIN namespace barrier {
+#define BOOST_FUSION_BARRIER_END }
+
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1900))
+// All of rvalue-reference ready MSVC don't perform implicit conversion from
+// fundamental type to rvalue-reference of another fundamental type [1].
+//
+// Following example doesn't compile
+//
+// int i;
+// long &&l = i; // sigh..., std::forward<long&&>(i) also fail.
+//
+// however, following one will work.
+//
+// int i;
+// long &&l = static_cast<long &&>(i);
+//
+// OK, now can we replace all usage of std::forward to static_cast? -- I say NO!
+// All of rvalue-reference ready Clang doesn't compile above static_cast usage [2], sigh...
+//
+// References:
+// 1. https://connect.microsoft.com/VisualStudio/feedback/details/1037806/implicit-conversion-doesnt-perform-for-fund
+// 2. http://llvm.org/bugs/show_bug.cgi?id=19917
+//
+// Tentatively, we use static_cast to forward if run under MSVC.
+# define BOOST_FUSION_FWD_ELEM(type, value) static_cast<type&&>(value)
+#else
+# define BOOST_FUSION_FWD_ELEM(type, value) std::forward<type>(value)
+#endif
+
+
+// Workaround for LWG 2408: C++17 SFINAE-friendly std::iterator_traits.
+// http://cplusplus.github.io/LWG/lwg-defects.html#2408
+//
+// - GCC 4.5 enables the feature under C++11.
+// https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01105.html
+//
+// - MSVC 10.0 implements iterator intrinsics; MSVC 13.0 implements LWG2408.
+#if (defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 40500) && \
+ defined(BOOST_LIBSTDCXX11)) || \
+ (defined(BOOST_MSVC) && (1600 <= BOOST_MSVC || BOOST_MSVC < 1900))
+# define BOOST_FUSION_WORKAROUND_FOR_LWG_2408
+namespace std
+{
+ template <typename>
+ struct iterator_traits;
+}
+#endif
+
#endif
diff --git a/boost/fusion/support/deduce.hpp b/boost/fusion/support/deduce.hpp
index 8d53115ffc..b75381c5b3 100644
--- a/boost/fusion/support/deduce.hpp
+++ b/boost/fusion/support/deduce.hpp
@@ -12,6 +12,10 @@
#include <boost/fusion/support/config.hpp>
#include <boost/ref.hpp>
+#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
+#include <functional>
+#endif
+
namespace boost { namespace fusion { namespace traits
{
template <typename T> struct deduce;
@@ -86,6 +90,21 @@ namespace boost { namespace fusion { namespace traits
typedef T& type;
};
+ // Also unwrap C++11 std::ref if available (referencee cv is deduced)
+#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
+ template <typename T>
+ struct deduce<std::reference_wrapper<T> &>
+ {
+ typedef T& type;
+ };
+
+ template <typename T>
+ struct deduce<std::reference_wrapper<T> const &>
+ {
+ typedef T& type;
+ };
+#endif
+
// Keep references on arrays, even if const
template <typename T, int N>
diff --git a/boost/fusion/support/detail/as_fusion_element.hpp b/boost/fusion/support/detail/as_fusion_element.hpp
index 628dca4d16..2af960eedf 100644
--- a/boost/fusion/support/detail/as_fusion_element.hpp
+++ b/boost/fusion/support/detail/as_fusion_element.hpp
@@ -11,6 +11,10 @@
#include <boost/fusion/support/config.hpp>
#include <boost/ref.hpp>
+#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
+#include <functional>
+#endif
+
namespace boost { namespace fusion { namespace detail
{
template <typename T>
@@ -25,6 +29,14 @@ namespace boost { namespace fusion { namespace detail
typedef T& type;
};
+#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
+ template <typename T>
+ struct as_fusion_element<std::reference_wrapper<T> >
+ {
+ typedef T& type;
+ };
+#endif
+
template <typename T, int N>
struct as_fusion_element<T[N]>
{
diff --git a/boost/fusion/support/detail/enabler.hpp b/boost/fusion/support/detail/enabler.hpp
new file mode 100644
index 0000000000..48b69f3227
--- /dev/null
+++ b/boost/fusion/support/detail/enabler.hpp
@@ -0,0 +1,18 @@
+/*=============================================================================
+ Copyright (c) 2015 Kohei Takahashi
+
+ Use modification and distribution are subject to the Boost Software
+ License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+==============================================================================*/
+#ifndef FUSION_DETAIL_ENABLER_02082015_163810
+#define FUSION_DETAIL_ENABLER_02082015_163810
+
+namespace boost { namespace fusion { namespace detail
+{
+ template <typename, typename T = void>
+ struct enabler { typedef T type; };
+}}}
+
+#endif
+
diff --git a/boost/fusion/support/detail/result_of.hpp b/boost/fusion/support/detail/result_of.hpp
new file mode 100644
index 0000000000..e53ea9e354
--- /dev/null
+++ b/boost/fusion/support/detail/result_of.hpp
@@ -0,0 +1,53 @@
+/*=============================================================================
+ Copyright (c) 2001-2014 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#if !defined(FUSION_RESULT_OF_10272014_0654)
+#define FUSION_RESULT_OF_10272014_0654
+
+#include <boost/config.hpp>
+#include <boost/utility/result_of.hpp>
+
+#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+#define BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF
+#endif
+
+#if !defined(BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF)
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/has_xxx.hpp>
+#endif
+
+namespace boost { namespace fusion { namespace detail
+{
+ // This is a temporary workaround for result_of before we make fusion fully
+ // sfinae result_of friendy, which will require some heavy lifting for some
+ // low level code. So far this is used only in the fold algorithm. This will
+ // be removed once we overhaul fold.
+
+#if defined(BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF)
+
+ template <typename Sig>
+ struct result_of_with_decltype : boost::tr1_result_of<Sig> {};
+
+#else // defined(BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF)
+
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
+ BOOST_MPL_HAS_XXX_TEMPLATE_DEF(result)
+
+ template <typename Sig>
+ struct result_of_with_decltype;
+
+ template <typename F, typename... Args>
+ struct result_of_with_decltype<F(Args...)>
+ : mpl::if_<mpl::or_<has_result_type<F>, detail::has_result<F> >,
+ boost::tr1_result_of<F(Args...)>,
+ boost::detail::cpp0x_result_of<F(Args...)> >::type {};
+
+#endif // defined(BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF)
+
+}}}
+
+#endif
diff --git a/boost/fusion/support/detail/segmented_fold_until_impl.hpp b/boost/fusion/support/detail/segmented_fold_until_impl.hpp
index 514e8d950b..6a388bf834 100644
--- a/boost/fusion/support/detail/segmented_fold_until_impl.hpp
+++ b/boost/fusion/support/detail/segmented_fold_until_impl.hpp
@@ -66,8 +66,8 @@ namespace boost { namespace fusion
}
template <typename Cur, typename Context>
- BOOST_FUSION_GPU_ENABLED
- typename result_of::make_segmented_iterator<Cur, Context>::type
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ inline typename result_of::make_segmented_iterator<Cur, Context>::type
make_segmented_iterator(Cur const& cur, Context const& context)
{
typedef result_of::make_segmented_iterator<Cur, Context> impl_type;
@@ -121,7 +121,7 @@ namespace boost { namespace fusion
typedef iterator_range<Cur, End> range_type;
typedef cons<range_type, Context> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Cur const& cur, End const& end, Context const& context)
{
return cons<range_type, Context>(range_type(cur, end), context);
@@ -170,7 +170,7 @@ namespace boost { namespace fusion
typedef typename impl::type type;
typedef typename impl::continue_type continue_type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun)
{
return impl::call(fusion::segments(seq), state, context, fun);
@@ -192,7 +192,7 @@ namespace boost { namespace fusion
typedef typename apply_type::type type;
typedef typename apply_type::continue_type continue_type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun)
{
return apply_type::call(seq, state, context, fun);
@@ -274,14 +274,14 @@ namespace boost { namespace fusion
>::type
continue_type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Begin const& beg, End const& end, State const& state
, Context const& context, Fun const& fun)
{
return call(beg, end, state, context, fun, typename fold_recurse_impl::continue_type());
}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Begin const& beg, End const& end, State const& state
, Context const& context, Fun const& fun, mpl::true_) // continue
{
@@ -297,7 +297,7 @@ namespace boost { namespace fusion
, fun);
}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Begin const& beg, End const& end, State const& state
, Context const& context, Fun const& fun, mpl::false_) // break
{
@@ -325,7 +325,7 @@ namespace boost { namespace fusion
typedef typename impl::type type;
typedef typename impl::continue_type continue_type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Begin const& beg, End const& end, State const& state
, Context const& context, Fun const& fun)
{
@@ -351,7 +351,7 @@ namespace boost { namespace fusion
typedef typename impl::type type;
typedef typename impl::continue_type continue_type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Begin const& beg, End const& end, State const& state
, Context const& context, Fun const& fun)
{
@@ -365,7 +365,7 @@ namespace boost { namespace fusion
typedef State type;
typedef mpl::true_ continue_type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Begin const&, End const&, State const& state
, Context const&, Fun const&)
{
@@ -389,7 +389,7 @@ namespace boost { namespace fusion
typedef typename impl::type type;
typedef typename impl::continue_type continue_type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Segments& segs, State const& state, Context const& context, Fun const& fun)
{
return impl::call(fusion::begin(segs), fusion::end(segs), state, context, fun);
diff --git a/boost/fusion/support/is_sequence.hpp b/boost/fusion/support/is_sequence.hpp
index 8b5821042f..6b9b211858 100644
--- a/boost/fusion/support/is_sequence.hpp
+++ b/boost/fusion/support/is_sequence.hpp
@@ -32,7 +32,7 @@ namespace boost { namespace fusion
{
template <typename Sequence>
struct apply
- : is_convertible<Sequence, detail::from_sequence_convertible_type>
+ : is_convertible<Sequence, fusion::detail::from_sequence_convertible_type>
{};
};
@@ -69,7 +69,7 @@ namespace boost { namespace fusion
template <typename Sequence, typename Enable = void>
struct is_native_fusion_sequence
- : is_convertible<Sequence, detail::from_sequence_convertible_type>
+ : is_convertible<Sequence, fusion::detail::from_sequence_convertible_type>
{};
}
}}
diff --git a/boost/fusion/support/iterator_base.hpp b/boost/fusion/support/iterator_base.hpp
index d23d05c62e..5d8ce3abb7 100644
--- a/boost/fusion/support/iterator_base.hpp
+++ b/boost/fusion/support/iterator_base.hpp
@@ -7,6 +7,7 @@
#if !defined(FUSION_ITERATOR_BASE_05042005_1008)
#define FUSION_ITERATOR_BASE_05042005_1008
+#include <boost/config.hpp>
#include <boost/fusion/support/config.hpp>
namespace boost { namespace fusion
@@ -16,16 +17,16 @@ namespace boost { namespace fusion
template <typename Iterator>
struct iterator_base : iterator_root
{
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
Iterator const&
- cast() const
+ cast() const BOOST_NOEXCEPT
{
return static_cast<Iterator const&>(*this);
}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
Iterator&
- cast()
+ cast() BOOST_NOEXCEPT
{
return static_cast<Iterator&>(*this);
}
diff --git a/boost/fusion/support/pair.hpp b/boost/fusion/support/pair.hpp
index c547926e9b..fd5d57e687 100644
--- a/boost/fusion/support/pair.hpp
+++ b/boost/fusion/support/pair.hpp
@@ -16,6 +16,7 @@
#include <boost/config.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_lvalue_reference.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
@@ -28,48 +29,47 @@ namespace boost { namespace fusion
template <typename First, typename Second>
struct pair
{
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
pair()
: second() {}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
pair(pair const& rhs)
: second(rhs.second) {}
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
pair(pair&& rhs)
- : second(std::forward<Second>(rhs.second)) {}
+ : second(BOOST_FUSION_FWD_ELEM(Second, rhs.second)) {}
#endif
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
pair(typename detail::call_param<Second>::type val)
: second(val) {}
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
-
template <typename Second2>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
pair(Second2&& val
+ , typename boost::disable_if<is_lvalue_reference<Second2> >::type* /* dummy */ = 0
, typename boost::enable_if<is_convertible<Second2, Second> >::type* /*dummy*/ = 0
- ) : second(std::forward<Second2>(val)) {}
-
+ ) : second(BOOST_FUSION_FWD_ELEM(Second, val)) {}
#endif
template <typename Second2>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
pair(pair<First, Second2> const& rhs)
: second(rhs.second) {}
template <typename Second2>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
pair& operator=(pair<First, Second2> const& rhs)
{
second = rhs.second;
return *this;
}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
pair& operator=(pair const& rhs)
{
second = rhs.second;
@@ -77,10 +77,10 @@ namespace boost { namespace fusion
}
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
pair& operator=(pair&& rhs)
{
- second = std::forward<Second>(rhs.second);
+ second = BOOST_FUSION_FWD_ELEM(Second, rhs.second);
return *this;
}
#endif
@@ -113,7 +113,7 @@ namespace boost { namespace fusion
}
template <typename First, typename Second>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::make_pair<First,Second>::type
make_pair(Second const& val)
{
@@ -137,7 +137,7 @@ namespace boost { namespace fusion
}
template <typename First, typename SecondL, typename SecondR>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline bool
operator==(pair<First, SecondL> const& l, pair<First, SecondR> const& r)
{
@@ -145,7 +145,7 @@ namespace boost { namespace fusion
}
template <typename First, typename SecondL, typename SecondR>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline bool
operator!=(pair<First, SecondL> const& l, pair<First, SecondR> const& r)
{
@@ -153,7 +153,7 @@ namespace boost { namespace fusion
}
template <typename First, typename SecondL, typename SecondR>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline bool
operator<(pair<First, SecondL> const& l, pair<First, SecondR> const& r)
{
diff --git a/boost/fusion/support/segmented_fold_until.hpp b/boost/fusion/support/segmented_fold_until.hpp
index 8d3ea68219..9e6f4a50f6 100644
--- a/boost/fusion/support/segmented_fold_until.hpp
+++ b/boost/fusion/support/segmented_fold_until.hpp
@@ -45,8 +45,8 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename State, typename Fun>
- BOOST_FUSION_GPU_ENABLED
- typename
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ inline typename
lazy_disable_if<
is_const<Sequence>
, result_of::segmented_fold_until<Sequence, State, Fun>
@@ -56,19 +56,19 @@ namespace boost { namespace fusion
typedef
typename result_of::segmented_fold_until<Sequence, State, Fun>::filter
filter;
-
+
return filter::call(seq, state, fusion::nil_(), fun);
}
template <typename Sequence, typename State, typename Fun>
- BOOST_FUSION_GPU_ENABLED
- typename result_of::segmented_fold_until<Sequence const, State, Fun>::type
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ inline typename result_of::segmented_fold_until<Sequence const, State, Fun>::type
segmented_fold_until(Sequence const& seq, State const& state, Fun const& fun)
{
typedef
typename result_of::segmented_fold_until<Sequence const, State, Fun>::filter
filter;
-
+
return filter::call(seq, state, fusion::nil_(), fun);
}
}}
diff --git a/boost/fusion/support/sequence_base.hpp b/boost/fusion/support/sequence_base.hpp
index b59121c09b..2f9320e6c8 100644
--- a/boost/fusion/support/sequence_base.hpp
+++ b/boost/fusion/support/sequence_base.hpp
@@ -8,6 +8,7 @@
#if !defined(FUSION_SEQUENCE_BASE_04182005_0737)
#define FUSION_SEQUENCE_BASE_04182005_0737
+#include <boost/config.hpp>
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/begin_end_fwd.hpp>
@@ -22,22 +23,22 @@ namespace boost { namespace fusion
template <typename Sequence>
struct sequence_base
{
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
Sequence const&
- derived() const
+ derived() const BOOST_NOEXCEPT
{
return static_cast<Sequence const&>(*this);
}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
Sequence&
- derived()
+ derived() BOOST_NOEXCEPT
{
return static_cast<Sequence&>(*this);
}
- BOOST_FUSION_GPU_ENABLED
- operator detail::from_sequence_convertible_type()const
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ operator detail::from_sequence_convertible_type() const BOOST_NOEXCEPT
{
return detail::from_sequence_convertible_type();
}
diff --git a/boost/fusion/support/unused.hpp b/boost/fusion/support/unused.hpp
index b3eec5ce13..4bbe24e88b 100644
--- a/boost/fusion/support/unused.hpp
+++ b/boost/fusion/support/unused.hpp
@@ -22,65 +22,67 @@ namespace boost { namespace fusion
{
struct unused_type
{
- BOOST_FUSION_GPU_ENABLED
- unused_type()
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ unused_type() BOOST_NOEXCEPT
{
}
template <typename T>
- BOOST_FUSION_GPU_ENABLED
- unused_type(T const&)
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ unused_type(T const&) BOOST_NOEXCEPT
{
}
template <typename T>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
unused_type const&
- operator=(T const&) const
+ operator=(T const&) const BOOST_NOEXCEPT
{
return *this;
}
template <typename T>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
unused_type&
- operator=(T const&)
+ operator=(T const&) BOOST_NOEXCEPT
{
return *this;
}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
unused_type const&
- operator=(unused_type const&) const
+ operator=(unused_type const&) const BOOST_NOEXCEPT
{
return *this;
}
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
unused_type&
- operator=(unused_type const&)
+ operator=(unused_type const&) BOOST_NOEXCEPT
{
return *this;
}
};
- unused_type const unused = unused_type();
+ BOOST_CONSTEXPR unused_type const unused = unused_type();
namespace detail
{
struct unused_only
{
- BOOST_FUSION_GPU_ENABLED
- unused_only(unused_type const&) {}
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ unused_only(unused_type const&) BOOST_NOEXCEPT {}
};
}
- inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&)
+ BOOST_CONSTEXPR
+ inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&) BOOST_NOEXCEPT
{
return out;
}
- inline std::istream& operator>>(std::istream& in, unused_type&)
+ BOOST_CONSTEXPR
+ inline std::istream& operator>>(std::istream& in, unused_type&) BOOST_NOEXCEPT
{
return in;
}