From 455e6129bec2a8d56858a189c32af15991efe8db Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Tue, 19 Sep 2017 14:51:45 +0300 Subject: [PATCH] Added a workaround for clang 3.0 not supporting decltype in base class list. Use an additional proxy class to define the base class using decltype in a typedef, which is supported by the compiler, judging by Boost.Config tests. --- include/boost/type_traits/is_nothrow_swappable.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits/is_nothrow_swappable.hpp b/include/boost/type_traits/is_nothrow_swappable.hpp index b355664..397f296 100644 --- a/include/boost/type_traits/is_nothrow_swappable.hpp +++ b/include/boost/type_traits/is_nothrow_swappable.hpp @@ -26,17 +26,21 @@ using std::swap; template(), declval()))> integral_constant is_nothrow_swappable_with_impl( int ); template false_type is_nothrow_swappable_with_impl( ... ); +template +struct is_nothrow_swappable_with_helper { typedef decltype( type_traits_swappable_detail::is_nothrow_swappable_with_impl(0) ) type; }; template(), declval()))> integral_constant is_nothrow_swappable_impl( int ); template false_type is_nothrow_swappable_impl( ... ); +template +struct is_nothrow_swappable_helper { typedef decltype( type_traits_swappable_detail::is_nothrow_swappable_impl(0) ) type; }; } // namespace type_traits_swappable_detail -template struct is_nothrow_swappable_with: decltype( type_traits_swappable_detail::is_nothrow_swappable_with_impl(0) ) +template struct is_nothrow_swappable_with: type_traits_swappable_detail::is_nothrow_swappable_with_helper::type { }; -template struct is_nothrow_swappable: decltype( type_traits_swappable_detail::is_nothrow_swappable_impl(0) ) +template struct is_nothrow_swappable: type_traits_swappable_detail::is_nothrow_swappable_helper::type { };