diff --git a/include/boost/fusion/container/generation/make_vector.hpp b/include/boost/fusion/container/generation/make_vector.hpp index 4a237011..cd3b992b 100644 --- a/include/boost/fusion/container/generation/make_vector.hpp +++ b/include/boost/fusion/container/generation/make_vector.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion template struct trim_void > { - typedef vector, U...> type; + typedef vector type; }; template diff --git a/include/boost/fusion/container/vector/detail/as_vector.hpp b/include/boost/fusion/container/vector/detail/as_vector.hpp index 322f3dd6..e2f45b6a 100644 --- a/include/boost/fusion/container/vector/detail/as_vector.hpp +++ b/include/boost/fusion/container/vector/detail/as_vector.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2014 Kohei Takahashi + Copyright (c) 2014-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) @@ -41,8 +41,7 @@ BOOST_FUSION_BARRIER_BEGIN struct apply { typedef vector< - numbered_vector_tag - , typename result_of::value_of< + typename result_of::value_of< typename result_of::advance_c::type >::type... > type; diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index b330b3a2..ab1c1f04 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -254,33 +253,11 @@ namespace boost { namespace fusion } }; - // Internal use only specialization for implementing vectorN. - // Simple aliasing (like a using vectorN = vector) will cause specialization confliction - // like following. - // - // template struct SomeClass; - // template struct SomeClass> { ... }; - // template - // struct SomeClass> // Error, since vector and vector1 are exact same type. - // { ... }; - // - // Introducing `numbered_vector_tag` will resolve such specialization error. - // - // template - // struct SomeClass> { ... }; - // template - // struct SomeClass> // OK - // { ... }; - // - // // Same meaning as above specialization. - // template - // struct SomeClass, T>> - // { ... }; template - struct construct_vector_; + struct trim_void_; template - struct construct_vector_ > + struct trim_void_ > { typedef vector_data< typename detail::make_index_sequence::type @@ -288,35 +265,24 @@ namespace boost { namespace fusion > type; }; - template - struct construct_vector_, T...> > - { - typedef vector_data< - typename detail::make_index_sequence::type - , T... - > type; + template + struct trim_void_, void_, Tail...> + : trim_void_ > {}; - BOOST_STATIC_ASSERT((type::size::value == N)); - }; - - template - struct construct_vector_, void_, Tail...> - : construct_vector_ > {}; - - template - struct construct_vector_, Head, Tail...> - : construct_vector_, Tail...> {}; + template + struct trim_void_, Head, Tail...> + : trim_void_, Tail...> {}; template - struct construct_vector : construct_vector_, T...> {}; + struct trim_void : trim_void_, T...> {}; } // namespace boost::fusion::vector_detail // This class provides backward compatibility: vector. template struct vector - : vector_detail::construct_vector::type + : vector_detail::trim_void::type { - typedef typename vector_detail::construct_vector::type base; + typedef typename vector_detail::trim_void::type base; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector() diff --git a/include/boost/fusion/container/vector/vector_fwd.hpp b/include/boost/fusion/container/vector/vector_fwd.hpp index 641b19ef..dcb0a0fc 100644 --- a/include/boost/fusion/container/vector/vector_fwd.hpp +++ b/include/boost/fusion/container/vector/vector_fwd.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2014 Kohei Takahashi + Copyright (c) 2014-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) @@ -23,19 +23,15 @@ /////////////////////////////////////////////////////////////////////////////// #include #include -#include namespace boost { namespace fusion { template struct vector; - template - struct numbered_vector_tag; - #define FUSION_VECTOR_N_ALIASES(z, N, d) \ template \ - using BOOST_PP_CAT(vector, N) = vector, T...>; + using BOOST_PP_CAT(vector, N) = vector; BOOST_PP_REPEAT(51, FUSION_VECTOR_N_ALIASES, ~)