From e174af228695e8b4f1fa6152b29c107bb694e00f Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 30 Sep 2016 00:32:19 +0100 Subject: [PATCH] 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++. --- include/boost/unordered/detail/allocate.hpp | 25 +++++---------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/include/boost/unordered/detail/allocate.hpp b/include/boost/unordered/detail/allocate.hpp index 4a6a2ae3..319c9cd5 100644 --- a/include/boost/unordered/detail/allocate.hpp +++ b/include/boost/unordered/detail/allocate.hpp @@ -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(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 @@ -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 @@ -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 @@ -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 @@ -205,6 +189,9 @@ inline emplace_args3 create_emplace_args( #define BOOST_UNORDERED_CALL_FORWARD(z, i, a) \ boost::forward(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 \ struct BOOST_PP_CAT(emplace_args, n) \