Use boost::declval instead of std::declval, close #10190.

Thanks-to: Niklas Angare
This commit is contained in:
Niklas Angare
2014-07-11 14:26:14 -04:00
committed by Kohei Takahashi
parent 6b6d613e15
commit 3b3da1a10a
5 changed files with 16 additions and 11 deletions

View File

@ -9,6 +9,7 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/detail/access.hpp> #include <boost/fusion/support/detail/access.hpp>
#include <boost/utility/declval.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -27,7 +28,7 @@ namespace boost { namespace fusion
{ {
typedef mpl::int_<N::value> index; typedef mpl::int_<N::value> index;
typedef typedef
decltype(std::declval<Sequence>().get(index())) decltype(boost::declval<Sequence>().get(index()))
type; type;
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED
@ -43,7 +44,7 @@ namespace boost { namespace fusion
{ {
typedef mpl::int_<N::value> index; typedef mpl::int_<N::value> index;
typedef typedef
decltype(std::declval<Sequence const>().get(index())) decltype(boost::declval<Sequence const>().get(index()))
type; type;
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED

View File

@ -12,6 +12,7 @@
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/mpl/at.hpp> #include <boost/mpl/at.hpp>
#include <boost/mpl/identity.hpp> #include <boost/mpl/identity.hpp>
#include <boost/utility/declval.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -29,7 +30,7 @@ namespace boost { namespace fusion
struct apply struct apply
{ {
typedef typedef
decltype(std::declval<Sequence>().get(mpl::identity<Key>())) decltype(boost::declval<Sequence>().get(mpl::identity<Key>()))
type; type;
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED
@ -44,7 +45,7 @@ namespace boost { namespace fusion
struct apply<Sequence const, Key> struct apply<Sequence const, Key>
{ {
typedef typedef
decltype(std::declval<Sequence const>().get(mpl::identity<Key>())) decltype(boost::declval<Sequence const>().get(mpl::identity<Key>()))
type; type;
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED

View File

@ -9,6 +9,7 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/mpl/at.hpp> #include <boost/mpl/at.hpp>
#include <boost/utility/declval.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -27,7 +28,7 @@ namespace boost { namespace fusion
{ {
typedef mpl::int_<N::value> index; typedef mpl::int_<N::value> index;
typedef typedef
decltype(std::declval<Sequence>().get_val(index())) decltype(boost::declval<Sequence>().get_val(index()))
type; type;
}; };
}; };

View File

@ -12,6 +12,7 @@
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/mpl/at.hpp> #include <boost/mpl/at.hpp>
#include <boost/mpl/identity.hpp> #include <boost/mpl/identity.hpp>
#include <boost/utility/declval.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -29,7 +30,7 @@ namespace boost { namespace fusion
struct apply struct apply
{ {
typedef typedef
decltype(std::declval<Sequence>().get_val(mpl::identity<Key>())) decltype(boost::declval<Sequence>().get_val(mpl::identity<Key>()))
type; type;
}; };
}; };

View File

@ -12,6 +12,7 @@
#include <boost/fusion/iterator/iterator_facade.hpp> #include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/mpl/minus.hpp> #include <boost/mpl/minus.hpp>
#include <boost/mpl/equal_to.hpp> #include <boost/mpl/equal_to.hpp>
#include <boost/utility/declval.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -37,7 +38,7 @@ namespace boost { namespace fusion
typedef typename Iterator::sequence sequence; typedef typename Iterator::sequence sequence;
typedef typename Iterator::index index; typedef typename Iterator::index index;
typedef typedef
decltype(std::declval<sequence>().get_val(index())) decltype(boost::declval<sequence>().get_val(index()))
type; type;
}; };
@ -47,7 +48,7 @@ namespace boost { namespace fusion
typedef typename Iterator::sequence sequence; typedef typename Iterator::sequence sequence;
typedef typename Iterator::index index; typedef typename Iterator::index index;
typedef typedef
decltype(std::declval<sequence>().get_val(index()).second) decltype(boost::declval<sequence>().get_val(index()).second)
type; type;
}; };
@ -56,7 +57,7 @@ namespace boost { namespace fusion
{ {
typedef typename Iterator::sequence sequence; typedef typename Iterator::sequence sequence;
typedef typename Iterator::index index; typedef typename Iterator::index index;
typedef decltype(std::declval<sequence>().get_key(index())) key_identity_type; typedef decltype(boost::declval<sequence>().get_key(index())) key_identity_type;
typedef typename key_identity_type::type type; typedef typename key_identity_type::type type;
}; };
@ -66,7 +67,7 @@ namespace boost { namespace fusion
typedef typename Iterator::sequence sequence; typedef typename Iterator::sequence sequence;
typedef typename Iterator::index index; typedef typename Iterator::index index;
typedef typedef
decltype(std::declval<sequence>().get(index())) decltype(boost::declval<sequence>().get(index()))
type; type;
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED
@ -83,7 +84,7 @@ namespace boost { namespace fusion
typedef typename Iterator::sequence sequence; typedef typename Iterator::sequence sequence;
typedef typename Iterator::index index; typedef typename Iterator::index index;
typedef typedef
decltype(std::declval<sequence>().get(index()).second) decltype(boost::declval<sequence>().get(index()).second)
type; type;
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED