Merge pull request #50 from Lastique/fix_clang30_decltype

Add a workaround for clang 3.0 not supporting decltype in base class list
This commit is contained in:
jzmaddock
2017-10-26 18:34:02 +01:00
committed by GitHub

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
{
};