diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:30:07 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:32:57 +0900 |
commit | 71d216b90256936a9638f325af9bc69d720e75de (patch) | |
tree | 9c5f682d341c7c88ad0c8e3d4b262e00b6fb691a /boost/fusion/support | |
parent | 733b5d5ae2c5d625211e2985ac25728ac3f54883 (diff) | |
download | boost-71d216b90256936a9638f325af9bc69d720e75de.tar.gz boost-71d216b90256936a9638f325af9bc69d720e75de.tar.bz2 boost-71d216b90256936a9638f325af9bc69d720e75de.zip |
Imported Upstream version 1.59.0
Change-Id: I2dde00f4eca71df3eea9d251dcaecde18a6c90a5
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/fusion/support')
-rw-r--r-- | boost/fusion/support/category_of.hpp | 9 | ||||
-rw-r--r-- | boost/fusion/support/config.hpp | 13 | ||||
-rw-r--r-- | boost/fusion/support/detail/index_sequence.hpp | 59 | ||||
-rw-r--r-- | boost/fusion/support/pair.hpp | 2 | ||||
-rw-r--r-- | boost/fusion/support/unused.hpp | 6 |
5 files changed, 83 insertions, 6 deletions
diff --git a/boost/fusion/support/category_of.hpp b/boost/fusion/support/category_of.hpp index 6bdf6d0291..92b0ea1b60 100644 --- a/boost/fusion/support/category_of.hpp +++ b/boost/fusion/support/category_of.hpp @@ -36,6 +36,8 @@ namespace boost { namespace fusion struct associative_tag {}; + struct unbounded_tag {}; + namespace extension { template<typename Tag> @@ -107,6 +109,13 @@ namespace boost { namespace fusion random_access_traversal_tag , typename category_of<T>::type> {}; + + template <typename T> + struct is_unbounded + : is_base_of< + unbounded_tag + , typename category_of<T>::type> + {}; } }} diff --git a/boost/fusion/support/config.hpp b/boost/fusion/support/config.hpp index 10dc29df54..23554531b5 100644 --- a/boost/fusion/support/config.hpp +++ b/boost/fusion/support/config.hpp @@ -2,7 +2,7 @@ Copyright (c) 2014 Eric Niebler Copyright (c) 2014 Kohei Takahashi - Distributed under the Boost Software License, Version 1.0. (See accompanying + 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_SUPPORT_CONFIG_01092014_1718) @@ -10,6 +10,7 @@ #include <boost/config.hpp> #include <boost/detail/workaround.hpp> +#include <utility> #ifndef BOOST_FUSION_GPU_ENABLED #define BOOST_FUSION_GPU_ENABLED BOOST_GPU_ENABLED @@ -78,7 +79,7 @@ namespace boost { namespace fusion { namespace detail // - 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)) + (defined(BOOST_MSVC) && (1600 <= BOOST_MSVC && BOOST_MSVC < 1900)) # define BOOST_FUSION_WORKAROUND_FOR_LWG_2408 namespace std { @@ -87,4 +88,12 @@ namespace std } #endif + +// Workaround for older GCC that doesn't accept `this` in constexpr. +#if BOOST_WORKAROUND(BOOST_GCC, < 40700) +#define BOOST_FUSION_CONSTEXPR_THIS +#else +#define BOOST_FUSION_CONSTEXPR_THIS BOOST_CONSTEXPR +#endif + #endif diff --git a/boost/fusion/support/detail/index_sequence.hpp b/boost/fusion/support/detail/index_sequence.hpp new file mode 100644 index 0000000000..1b596e7239 --- /dev/null +++ b/boost/fusion/support/detail/index_sequence.hpp @@ -0,0 +1,59 @@ +/*============================================================================= + Copyright (c) 2015 Agustin K-ballo Berge + Copyright (c) 2015 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) +==============================================================================*/ + +#ifndef BOOST_FUSION_SUPPORT_DETAIL_INDEX_SEQUENCE_06232015_1038 +#define BOOST_FUSION_SUPPORT_DETAIL_INDEX_SEQUENCE_06232015_1038 + +#include <boost/fusion/support/config.hpp> +#include <cstddef> + +namespace boost { namespace fusion { namespace detail +{ + template <std::size_t ...Ints> + struct index_sequence + { + typedef std::size_t value_type; + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + static std::size_t size() BOOST_NOEXCEPT + { return sizeof...(Ints); } + + // non standard extension + typedef index_sequence type; + }; + + template <typename Left, typename Right> + struct _make_index_sequence_join; + + template <std::size_t... Left, std::size_t... Right> + struct _make_index_sequence_join< + index_sequence<Left...>, index_sequence<Right...> + > : index_sequence<Left..., (sizeof...(Left) + Right)...> + {}; + + template <std::size_t N> + struct make_index_sequence + : _make_index_sequence_join< + typename make_index_sequence<N / 2>::type + , typename make_index_sequence<N - N / 2>::type + > + {}; + + template <> + struct make_index_sequence<1> + : index_sequence<0> + {}; + + template <> + struct make_index_sequence<0> + : index_sequence<> + {}; +}}} + +#endif + diff --git a/boost/fusion/support/pair.hpp b/boost/fusion/support/pair.hpp index fd5d57e687..a4cd1ff092 100644 --- a/boost/fusion/support/pair.hpp +++ b/boost/fusion/support/pair.hpp @@ -49,7 +49,7 @@ namespace boost { namespace fusion #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template <typename Second2> - BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + 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 diff --git a/boost/fusion/support/unused.hpp b/boost/fusion/support/unused.hpp index 4bbe24e88b..964839ab25 100644 --- a/boost/fusion/support/unused.hpp +++ b/boost/fusion/support/unused.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion } template <typename T> - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_CONSTEXPR_THIS BOOST_FUSION_GPU_ENABLED unused_type const& operator=(T const&) const BOOST_NOEXCEPT { @@ -49,7 +49,7 @@ namespace boost { namespace fusion return *this; } - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_CONSTEXPR_THIS BOOST_FUSION_GPU_ENABLED unused_type const& operator=(unused_type const&) const BOOST_NOEXCEPT { @@ -64,7 +64,7 @@ namespace boost { namespace fusion } }; - BOOST_CONSTEXPR unused_type const unused = unused_type(); + BOOST_CONSTEXPR_OR_CONST unused_type unused = unused_type(); namespace detail { |