diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index f20e1de0..abe2d7bb 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -168,15 +168,9 @@ namespace boost { namespace fusion : elem(std::forward(rhs)) {} - using elem_type = T; T elem; }; - // placed outside of vector_data due to GCC < 6 bug - template - static inline BOOST_FUSION_GPU_ENABLED - store store_at_impl(store*); - template struct vector_data; @@ -228,23 +222,32 @@ namespace boost { namespace fusion #endif } - private: - template - using store_at = decltype(store_at_impl(static_cast(nullptr))); + template + static BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + U& at_detail(store* this_) + { + return this_->elem; + } + + template + static BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + U const& at_detail(store const* this_) + { + return this_->elem; + } - public: template BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename store_at::elem_type& at_impl(J) + auto at_impl(J) -> decltype(at_detail(&std::declval())) { - return store_at::elem; + return at_detail(this); } template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename store_at::elem_type const& at_impl(J) const + auto at_impl(J) const -> decltype(at_detail(&std::declval())) { - return store_at::elem; + return at_detail(this); } }; } // namespace boost::fusion::vector_detail