Added workaround for msvc-14.x

This commit is contained in:
Kohei Takahashi
2018-04-19 00:21:41 +09:00
parent 757541f9d2
commit a273cd8131
3 changed files with 21 additions and 10 deletions

View File

@ -1,5 +1,6 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2013 Joel de Guzman Copyright (c) 2001-2013 Joel de Guzman
Copyright (c) 2018 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) 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 #define BOOST_FUSION_MAP_DETAIL_VALUE_AT_KEY_IMPL_02042013_0821
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/utility/declval.hpp> #include <boost/utility/declval.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
@ -26,9 +26,9 @@ namespace boost { namespace fusion
template <typename Sequence, typename Key> template <typename Sequence, typename Key>
struct apply struct apply
{ {
typedef typename typedef typename BOOST_FUSION_IDENTIFIED_TYPE((
decltype(boost::declval<Sequence>().get_val(mpl::identity<Key>()))::type boost::declval<Sequence>().get_val(mpl::identity<Key>())
type; )) type;
}; };
}; };
} }

View File

@ -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 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) 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 #ifndef FUSION_VALUE_AT_IMPL_16122014_1641
#define FUSION_VALUE_AT_IMPL_16122014_1641 #define FUSION_VALUE_AT_IMPL_16122014_1641
#include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp> #include <boost/fusion/container/vector/detail/config.hpp>
@ -50,9 +49,9 @@ namespace boost { namespace fusion
template <typename Sequence, typename N> template <typename Sequence, typename N>
struct apply struct apply
{ {
typedef typename typedef typename BOOST_FUSION_IDENTIFIED_TYPE((
decltype(vector_detail::value_at_impl<N::value>(boost::declval<Sequence*>()))::type vector_detail::value_at_impl<N::value>(boost::declval<Sequence*>())
type; )) type;
}; };
}; };
} }

View File

@ -1,6 +1,6 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Eric Niebler 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 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) 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 #define BOOST_FUSION_CONSTEXPR_THIS BOOST_CONSTEXPR
#endif #endif
// Workaround for compiler which doesn't compile decltype(expr)::type.
// It expects decltype(expr) deduced as mpl::identity<T>.
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1913))
# include <boost/mpl/identity.hpp>
# define BOOST_FUSION_IDENTIFIED_TYPE(parenthesized_expr) \
boost::mpl::identity<decltype parenthesized_expr>::type::type
#else
# define BOOST_FUSION_IDENTIFIED_TYPE(parenthesized_expr) \
decltype parenthesized_expr ::type
#endif
#endif #endif