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.
This commit is contained in:
Andrey Semashev
2017-09-19 14:51:45 +03:00
parent b23f18cac2
commit 455e6129be

View File

@ -26,17 +26,21 @@ using std::swap;
template<class T, class U, bool B = noexcept(swap(declval<T>(), declval<U>()))> integral_constant<bool, B> is_nothrow_swappable_with_impl( int );
template<class T, class U> false_type is_nothrow_swappable_with_impl( ... );
template<class T, class U>
struct is_nothrow_swappable_with_helper { typedef decltype( type_traits_swappable_detail::is_nothrow_swappable_with_impl<T, U>(0) ) type; };
template<class T, bool B = noexcept(swap(declval<T&>(), declval<T&>()))> integral_constant<bool, B> is_nothrow_swappable_impl( int );
template<class T> false_type is_nothrow_swappable_impl( ... );
template<class T>
struct is_nothrow_swappable_helper { typedef decltype( type_traits_swappable_detail::is_nothrow_swappable_impl<T>(0) ) type; };
} // namespace type_traits_swappable_detail
template<class T, class U> struct is_nothrow_swappable_with: decltype( type_traits_swappable_detail::is_nothrow_swappable_with_impl<T, U>(0) )
template<class T, class U> struct is_nothrow_swappable_with: type_traits_swappable_detail::is_nothrow_swappable_with_helper<T, U>::type
{
};
template<class T> struct is_nothrow_swappable: decltype( type_traits_swappable_detail::is_nothrow_swappable_impl<T>(0) )
template<class T> struct is_nothrow_swappable: type_traits_swappable_detail::is_nothrow_swappable_helper<T>::type
{
};