Replace some usage of std::forward to static_cast.

For more details, See inline comment of include/boost/fusion/support/config.hpp .
This commit is contained in:
Kohei Takahashi
2014-11-25 22:23:55 +09:00
parent 687668c110
commit 9ab7774fd7
15 changed files with 61 additions and 32 deletions

View File

@ -8,7 +8,7 @@
#if !defined(FUSION_VECTOR_FORWARD_CTOR_07122005_1123)
#define FUSION_VECTOR_FORWARD_CTOR_07122005_1123
#define FUSION_FORWARD_CTOR_FORWARD(z, n, _) std::forward<U##n>(_##n)
#define FUSION_FORWARD_CTOR_FORWARD(z, n, _) BOOST_FUSION_FWD_ELEM(U##n, _##n)
#define BOOST_PP_FILENAME_1 \
<boost/fusion/container/vector/detail/vector_forward_ctor.hpp>

View File

@ -19,16 +19,16 @@
m##n(other.m##n)
#define FUSION_VECTOR_CTOR_FORWARD(z, n, _) \
m##n(std::forward<T##n>(other.m##n))
m##n(BOOST_FUSION_FWD_ELEM(T##n, other.m##n))
#define FUSION_VECTOR_CTOR_ARG_FWD(z, n, _) \
m##n(std::forward<U##n>(_##n))
m##n(BOOST_FUSION_FWD_ELEM(U##n, _##n))
#define FUSION_VECTOR_MEMBER_DECL(z, n, _) \
T##n m##n;
#define FUSION_VECTOR_MEMBER_FORWARD(z, n, _) \
std::forward<U##n>(_##n)
BOOST_FUSION_FWD_ELEM(U##n, _##n)
#define FUSION_VECTOR_MEMBER_ASSIGN(z, n, _) \
this->BOOST_PP_CAT(m, n) = vec.BOOST_PP_CAT(m, n);
@ -164,7 +164,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_PP_CAT(vector, N)(U0&& _0
, typename boost::enable_if<is_convertible<U0, T0> >::type* /*dummy*/ = 0
)
: base_type(std::forward<U0>(_0)) {}
: base_type(BOOST_FUSION_FWD_ELEM(U0, _0)) {}
#else
BOOST_PP_CAT(vector, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && arg))
: base_type(BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_FORWARD, arg)) {}

View File

@ -174,7 +174,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
vector&
operator=(T&& rhs)
{
vec = std::forward<T>(rhs);
vec = BOOST_FUSION_FWD_ELEM(T, rhs);
return *this;
}
#endif