diff --git a/include/boost/fusion/container/map/detail/value_at_key_impl.hpp b/include/boost/fusion/container/map/detail/value_at_key_impl.hpp index 10873087..da6259e6 100644 --- a/include/boost/fusion/container/map/detail/value_at_key_impl.hpp +++ b/include/boost/fusion/container/map/detail/value_at_key_impl.hpp @@ -1,5 +1,6 @@ /*============================================================================= Copyright (c) 2001-2013 Joel de Guzman + Copyright (c) 2018 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) @@ -8,7 +9,6 @@ #define BOOST_FUSION_MAP_DETAIL_VALUE_AT_KEY_IMPL_02042013_0821 #include -#include #include namespace boost { namespace fusion @@ -26,9 +26,9 @@ namespace boost { namespace fusion template struct apply { - typedef typename - decltype(boost::declval().get_val(mpl::identity()))::type - type; + typedef typename BOOST_FUSION_IDENTIFIED_TYPE(( + boost::declval().get_val(mpl::identity()) + )) type; }; }; } diff --git a/include/boost/fusion/container/vector/detail/value_at_impl.hpp b/include/boost/fusion/container/vector/detail/value_at_impl.hpp index d7270aed..a2dd5fcd 100644 --- a/include/boost/fusion/container/vector/detail/value_at_impl.hpp +++ b/include/boost/fusion/container/vector/detail/value_at_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2014 Kohei Takahashi + Copyright (c) 2014,2018 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) @@ -7,7 +7,6 @@ #ifndef FUSION_VALUE_AT_IMPL_16122014_1641 #define FUSION_VALUE_AT_IMPL_16122014_1641 -#include #include #include @@ -50,9 +49,9 @@ namespace boost { namespace fusion template struct apply { - typedef typename - decltype(vector_detail::value_at_impl(boost::declval()))::type - type; + typedef typename BOOST_FUSION_IDENTIFIED_TYPE(( + vector_detail::value_at_impl(boost::declval()) + )) type; }; }; } diff --git a/include/boost/fusion/support/config.hpp b/include/boost/fusion/support/config.hpp index 23554531..65fe2f35 100644 --- a/include/boost/fusion/support/config.hpp +++ b/include/boost/fusion/support/config.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 2014 Eric Niebler - Copyright (c) 2014 Kohei Takahashi + Copyright (c) 2014,2018 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) @@ -96,4 +96,16 @@ namespace std #define BOOST_FUSION_CONSTEXPR_THIS BOOST_CONSTEXPR #endif + +// Workaround for compiler which doesn't compile decltype(expr)::type. +// It expects decltype(expr) deduced as mpl::identity. +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1913)) +# include +# define BOOST_FUSION_IDENTIFIED_TYPE(parenthesized_expr) \ + boost::mpl::identity::type::type +#else +# define BOOST_FUSION_IDENTIFIED_TYPE(parenthesized_expr) \ + decltype parenthesized_expr ::type +#endif + #endif