From 181f302ee4c8153aa2ad91bfbc123294a34e05cb Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 15 Jun 2016 15:50:21 -0700 Subject: [PATCH] Fix Ticket 12140; mark only single-arg ctor as explicit. Thanks to Thimo for the patch. --- include/boost/utility/base_from_member.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/boost/utility/base_from_member.hpp b/include/boost/utility/base_from_member.hpp index fc0e13c..604541d 100644 --- a/include/boost/utility/base_from_member.hpp +++ b/include/boost/utility/base_from_member.hpp @@ -47,11 +47,11 @@ // {} // This macro should only persist within this file. -#define BOOST_PRIVATE_CTR_DEF( z, n, data ) \ - template < BOOST_PP_ENUM_PARAMS(n, typename T) > \ - explicit base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \ - : member( BOOST_PP_ENUM_PARAMS(n, x) ) \ - {} \ +#define BOOST_PRIVATE_CTR_DEF( z, n, data ) \ + template < BOOST_PP_ENUM_PARAMS(n, typename T) > \ + base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \ + : member( BOOST_PP_ENUM_PARAMS(n, x) ) \ + {} \ /**/ @@ -142,7 +142,8 @@ protected: : member() {} - BOOST_PP_REPEAT_FROM_TO( 1, BOOST_PP_INC(BOOST_BASE_FROM_MEMBER_MAX_ARITY), + template < typename T0 > explicit base_from_member( T0 x0 ) : member( x0 ) {} + BOOST_PP_REPEAT_FROM_TO( 2, BOOST_PP_INC(BOOST_BASE_FROM_MEMBER_MAX_ARITY), BOOST_PRIVATE_CTR_DEF, _ ) #endif