summaryrefslogtreecommitdiff
path: root/boost/fusion
diff options
context:
space:
mode:
Diffstat (limited to 'boost/fusion')
-rw-r--r--boost/fusion/container/deque/detail/cpp03/as_deque.hpp8
-rw-r--r--boost/fusion/container/map/detail/cpp03/as_map.hpp8
-rw-r--r--boost/fusion/container/map/map.hpp15
-rw-r--r--boost/fusion/container/set/detail/cpp03/as_set.hpp8
-rw-r--r--boost/fusion/container/vector/detail/cpp03/as_vector.hpp8
-rw-r--r--boost/fusion/container/vector/vector.hpp4
-rw-r--r--boost/fusion/support/detail/is_mpl_sequence.hpp3
-rw-r--r--boost/fusion/support/is_sequence.hpp9
8 files changed, 45 insertions, 18 deletions
diff --git a/boost/fusion/container/deque/detail/cpp03/as_deque.hpp b/boost/fusion/container/deque/detail/cpp03/as_deque.hpp
index e95daf3a19..860a2a2936 100644
--- a/boost/fusion/container/deque/detail/cpp03/as_deque.hpp
+++ b/boost/fusion/container/deque/detail/cpp03/as_deque.hpp
@@ -26,7 +26,13 @@ namespace boost { namespace fusion { namespace detail
BOOST_FUSION_BARRIER_BEGIN
template <int size>
- struct as_deque;
+ struct as_deque
+ {
+ BOOST_STATIC_ASSERT_MSG(
+ size <= FUSION_MAX_DEQUE_SIZE
+ , "FUSION_MAX_DEQUE_SIZE limit is too low"
+ );
+ };
template <>
struct as_deque<0>
diff --git a/boost/fusion/container/map/detail/cpp03/as_map.hpp b/boost/fusion/container/map/detail/cpp03/as_map.hpp
index efa836ba08..442c350cce 100644
--- a/boost/fusion/container/map/detail/cpp03/as_map.hpp
+++ b/boost/fusion/container/map/detail/cpp03/as_map.hpp
@@ -25,7 +25,13 @@ namespace boost { namespace fusion { namespace detail
BOOST_FUSION_BARRIER_BEGIN
template <int size, bool is_assoc>
- struct as_map;
+ struct as_map
+ {
+ BOOST_STATIC_ASSERT_MSG(
+ size <= FUSION_MAX_MAP_SIZE
+ , "FUSION_MAX_MAP_SIZE limit is too low"
+ );
+ };
template <bool is_assoc>
struct as_map<0, is_assoc>
diff --git a/boost/fusion/container/map/map.hpp b/boost/fusion/container/map/map.hpp
index ec9e58d32d..6704dbe409 100644
--- a/boost/fusion/container/map/map.hpp
+++ b/boost/fusion/container/map/map.hpp
@@ -67,24 +67,21 @@ namespace boost { namespace fusion
: base_type(std::forward<map>(seq))
{}
- template <typename Sequence>
+ template <typename Sequence, typename = typename enable_if<traits::is_sequence<Sequence>>::type>
BOOST_FUSION_GPU_ENABLED
- map(Sequence const& seq
- , typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
+ map(Sequence const& seq)
: base_type(begin(seq), detail::map_impl_from_iterator())
{}
- template <typename Sequence>
+ template <typename Sequence, typename = typename enable_if<traits::is_sequence<Sequence>>::type>
BOOST_FUSION_GPU_ENABLED
- map(Sequence& seq
- , typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
+ map(Sequence& seq)
: base_type(begin(seq), detail::map_impl_from_iterator())
{}
- template <typename Sequence>
+ template <typename Sequence, typename = typename enable_if<traits::is_sequence<Sequence>>::type>
BOOST_FUSION_GPU_ENABLED
- map(Sequence&& seq
- , typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
+ map(Sequence&& seq)
: base_type(begin(seq), detail::map_impl_from_iterator())
{}
diff --git a/boost/fusion/container/set/detail/cpp03/as_set.hpp b/boost/fusion/container/set/detail/cpp03/as_set.hpp
index c9159314b3..ec73a15800 100644
--- a/boost/fusion/container/set/detail/cpp03/as_set.hpp
+++ b/boost/fusion/container/set/detail/cpp03/as_set.hpp
@@ -25,7 +25,13 @@ namespace boost { namespace fusion { namespace detail
BOOST_FUSION_BARRIER_BEGIN
template <int size>
- struct as_set;
+ struct as_set
+ {
+ BOOST_STATIC_ASSERT_MSG(
+ size <= FUSION_MAX_SET_SIZE
+ , "FUSION_MAX_SET_SIZE limit is too low"
+ );
+ };
template <>
struct as_set<0>
diff --git a/boost/fusion/container/vector/detail/cpp03/as_vector.hpp b/boost/fusion/container/vector/detail/cpp03/as_vector.hpp
index bd7fa76be6..471f78408e 100644
--- a/boost/fusion/container/vector/detail/cpp03/as_vector.hpp
+++ b/boost/fusion/container/vector/detail/cpp03/as_vector.hpp
@@ -25,7 +25,13 @@ namespace boost { namespace fusion { namespace detail
BOOST_FUSION_BARRIER_BEGIN
template <int size>
- struct as_vector;
+ struct as_vector
+ {
+ BOOST_STATIC_ASSERT_MSG(
+ size <= FUSION_MAX_VECTOR_SIZE
+ , "FUSION_MAX_VECTOR_SIZE limit is too low"
+ );
+ };
template <>
struct as_vector<0>
diff --git a/boost/fusion/container/vector/vector.hpp b/boost/fusion/container/vector/vector.hpp
index 1d6c5f1f2d..4993e2eb7c 100644
--- a/boost/fusion/container/vector/vector.hpp
+++ b/boost/fusion/container/vector/vector.hpp
@@ -247,14 +247,14 @@ namespace boost { namespace fusion
template <typename J>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
- auto at_impl(J) -> decltype(at_detail<J::value>(this))
+ auto at_impl(J) -> decltype(at_detail<J::value>(&std::declval<vector_data&>()))
{
return at_detail<J::value>(this);
}
template <typename J>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
- auto at_impl(J) const -> decltype(at_detail<J::value>(this))
+ auto at_impl(J) const -> decltype(at_detail<J::value>(&std::declval<vector_data const&>()))
{
return at_detail<J::value>(this);
}
diff --git a/boost/fusion/support/detail/is_mpl_sequence.hpp b/boost/fusion/support/detail/is_mpl_sequence.hpp
index 1c485f91c5..24b8662402 100644
--- a/boost/fusion/support/detail/is_mpl_sequence.hpp
+++ b/boost/fusion/support/detail/is_mpl_sequence.hpp
@@ -13,6 +13,7 @@
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp>
+#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/is_convertible.hpp>
namespace boost { namespace fusion { namespace detail
@@ -20,7 +21,7 @@ namespace boost { namespace fusion { namespace detail
template <typename T>
struct is_mpl_sequence
: mpl::and_<
- mpl::not_<is_convertible<T, from_sequence_convertible_type> >
+ mpl::not_<mpl::and_<is_complete<T>, is_convertible<T, from_sequence_convertible_type> > >
, mpl::is_sequence<T> >
{};
}}}
diff --git a/boost/fusion/support/is_sequence.hpp b/boost/fusion/support/is_sequence.hpp
index 6b9b211858..af7c84e1d4 100644
--- a/boost/fusion/support/is_sequence.hpp
+++ b/boost/fusion/support/is_sequence.hpp
@@ -10,9 +10,11 @@
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/tag_of.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/bool.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/or.hpp>
-#include <boost/mpl/bool.hpp>
+#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -69,7 +71,10 @@ namespace boost { namespace fusion
template <typename Sequence, typename Enable = void>
struct is_native_fusion_sequence
- : is_convertible<Sequence, fusion::detail::from_sequence_convertible_type>
+ : mpl::and_<
+ is_complete<Sequence>,
+ is_convertible<Sequence, fusion::detail::from_sequence_convertible_type>
+ >
{};
}
}}