summaryrefslogtreecommitdiff
path: root/boost/fusion/container
diff options
context:
space:
mode:
Diffstat (limited to 'boost/fusion/container')
-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
6 files changed, 36 insertions, 15 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);
}