Try not using boost::forward in emplace_args constructor.

AFAICT it's not needed since the construct arguments and the members are
the same reference type. Maybe it was for older compilers? And it appears
to be causing issues with string literals in older versions of Visual
C++.
This commit is contained in:
Daniel James
2016-09-30 00:32:19 +01:00
parent 9decbe0cbd
commit e174af2286

View File

@ -120,10 +120,6 @@ namespace boost { namespace unordered { namespace detail {
typedef BOOST_FWD_REF(BOOST_PP_CAT(A, n)) BOOST_PP_CAT(Arg, n); \
BOOST_PP_CAT(Arg, n) BOOST_PP_CAT(a, n);
#define BOOST_UNORDERED_EARGS_INIT(z, n, _) \
BOOST_PP_CAT(a, n)( \
boost::forward<BOOST_PP_CAT(A,n)>(BOOST_PP_CAT(b, n)))
#else
#define BOOST_UNORDERED_EARGS_MEMBER(z, n, _) \
@ -131,9 +127,6 @@ namespace boost { namespace unordered { namespace detail {
BOOST_PP_CAT(Arg, n); \
BOOST_PP_CAT(Arg, n) BOOST_PP_CAT(a, n);
#define BOOST_UNORDERED_EARGS_INIT(z, n, _) \
BOOST_PP_CAT(a, n)(BOOST_PP_CAT(b, n))
#endif
template <typename A0>
@ -141,9 +134,7 @@ struct emplace_args1
{
BOOST_UNORDERED_EARGS_MEMBER(1, 0, _)
emplace_args1(Arg0 b0) :
BOOST_UNORDERED_EARGS_INIT(1, 0, _)
{}
emplace_args1(Arg0 b0) : a0(b0) {}
};
template <typename A0>
@ -160,10 +151,7 @@ struct emplace_args2
BOOST_UNORDERED_EARGS_MEMBER(1, 0, _)
BOOST_UNORDERED_EARGS_MEMBER(1, 1, _)
emplace_args2(Arg0 b0, Arg1 b1) :
BOOST_UNORDERED_EARGS_INIT(1, 0, _),
BOOST_UNORDERED_EARGS_INIT(1, 1, _)
{}
emplace_args2(Arg0 b0, Arg1 b1) : a0(b0), a1(b1) {}
};
template <typename A0, typename A1>
@ -182,11 +170,7 @@ struct emplace_args3
BOOST_UNORDERED_EARGS_MEMBER(1, 1, _)
BOOST_UNORDERED_EARGS_MEMBER(1, 2, _)
emplace_args3(Arg0 b0, Arg1 b1, Arg2 b2) :
BOOST_UNORDERED_EARGS_INIT(1, 0, _),
BOOST_UNORDERED_EARGS_INIT(1, 1, _),
BOOST_UNORDERED_EARGS_INIT(1, 2, _)
{}
emplace_args3(Arg0 b0, Arg1 b1, Arg2 b2) : a0(b0), a1(b1), a2(b2) {}
};
template <typename A0, typename A1, typename A2>
@ -205,6 +189,9 @@ inline emplace_args3<A0, A1, A2> create_emplace_args(
#define BOOST_UNORDERED_CALL_FORWARD(z, i, a) \
boost::forward<BOOST_PP_CAT(A,i)>(BOOST_PP_CAT(a,i))
#define BOOST_UNORDERED_EARGS_INIT(z, n, _) \
BOOST_PP_CAT(a, n)(BOOST_PP_CAT(b, n))
#define BOOST_UNORDERED_EARGS(z, n, _) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
struct BOOST_PP_CAT(emplace_args, n) \