Use call_param for deducing type better.

This commit is contained in:
Kohei Takahashi
2014-11-21 00:53:50 +09:00
parent aa4d67258b
commit d185bd5df6
7 changed files with 13 additions and 10 deletions

View File

@ -122,7 +122,8 @@ namespace boost { namespace fusion
#endif #endif
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED
explicit deque(Head const& head, Tail const&... tail) explicit deque(typename detail::call_param<Head>::type head
, typename detail::call_param<Tail>::type... tail)
: base(detail::deque_keyed_values<Head, Tail...>::construct(head, tail...)) : base(detail::deque_keyed_values<Head, Tail...>::construct(head, tail...))
{} {}

View File

@ -11,9 +11,14 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp> #include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/fusion/container/deque/detail/keyed_element.hpp> #include <boost/fusion/container/deque/detail/keyed_element.hpp>
#include <boost/mpl/int.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/mpl/identity.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>
namespace boost { namespace fusion { namespace boost { namespace fusion {

View File

@ -18,12 +18,11 @@
#include <boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp> #include <boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp>
#include <boost/fusion/container/deque/detail/cpp03/deque_initial_size.hpp> #include <boost/fusion/container/deque/detail/cpp03/deque_initial_size.hpp>
#include <boost/fusion/support/sequence_base.hpp> #include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/container/deque/detail/keyed_element.hpp> #include <boost/fusion/container/deque/detail/keyed_element.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp> #include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/is_convertible.hpp>
#include <boost/fusion/container/deque/deque_fwd.hpp> #include <boost/fusion/container/deque/deque_fwd.hpp>
@ -35,7 +34,6 @@
#include <boost/fusion/sequence/intrinsic/begin.hpp> #include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/mpl/bool.hpp> #include <boost/mpl/bool.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/void.hpp> #include <boost/fusion/support/void.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
@ -87,7 +85,7 @@ namespace boost { namespace fusion {
{} {}
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED
explicit deque(typename add_reference<typename add_const<T0>::type>::type t0) explicit deque(typename detail::call_param<T0>::type t0)
: base(t0, detail::nil_keyed_element()) : base(t0, detail::nil_keyed_element())
{} {}

View File

@ -36,7 +36,7 @@ FUSION_HASH if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
(defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED
deque(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference<typename add_const<T, >::type>::type t)) deque(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param<T, >::type t))
: base(detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(N, T)>::construct(BOOST_PP_ENUM_PARAMS(N, t))) : base(detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(N, T)>::construct(BOOST_PP_ENUM_PARAMS(N, t)))
{} {}
#endif #endif

View File

@ -35,7 +35,7 @@
#define N BOOST_PP_ITERATION() #define N BOOST_PP_ITERATION()
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED
static type construct(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference<typename add_const<T, >::type>::type t)) static type construct(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param<T, >::type t))
{ {
return type(t0, return type(t0,
deque_keyed_values_impl< deque_keyed_values_impl<

View File

@ -9,9 +9,8 @@
#define BOOST_FUSION_DEQUE_DETAIL_CPP11_DEQUE_KEYED_VALUES_07042012_1901 #define BOOST_FUSION_DEQUE_DETAIL_CPP11_DEQUE_KEYED_VALUES_07042012_1901
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/container/deque/detail/keyed_element.hpp> #include <boost/fusion/container/deque/detail/keyed_element.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/mpl/int.hpp> #include <boost/mpl/int.hpp>
namespace boost { namespace fusion { namespace detail namespace boost { namespace fusion { namespace detail

View File

@ -31,7 +31,7 @@
#if N == 1 #if N == 1
explicit explicit
#endif #endif
map(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& arg)) map(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param<T, >::type arg))
: data(BOOST_PP_ENUM_PARAMS(N, arg)) {} : data(BOOST_PP_ENUM_PARAMS(N, arg)) {}
#undef N #undef N