1
0
forked from boostorg/core

Slightly more succint sfinae expressions

This commit is contained in:
Glen Fernandes
2017-06-11 10:17:35 -04:00
parent 637b2ffaff
commit 6153eebc42

View File

@ -172,19 +172,14 @@ namespace detail {
template<class T>
T addressof_declval() BOOST_NOEXCEPT;
template<class>
struct addressof_void {
typedef void type;
};
template<class T, class E = void>
struct addressof_member_operator {
static constexpr bool value = false;
};
template<class T>
struct addressof_member_operator<T, typename
addressof_void<decltype(addressof_declval<T&>().operator&())>::type> {
struct addressof_member_operator<T,
decltype(addressof_declval<T&>().operator&(), void())> {
static constexpr bool value = true;
};
@ -201,8 +196,8 @@ struct addressof_non_member_operator {
};
template<class T>
struct addressof_non_member_operator<T, typename
addressof_void<decltype(operator&(addressof_declval<T&>()))>::type> {
struct addressof_non_member_operator<T,
decltype(operator&(addressof_declval<T&>()), void())> {
static constexpr bool value = true;
};
@ -213,7 +208,7 @@ struct addressof_expression {
template<class T>
struct addressof_expression<T,
typename addressof_void<decltype(&addressof_declval<T&>())>::type> {
decltype(&addressof_declval<T&>(), void())> {
static constexpr bool value = true;
};