From 6153eebc42b07d80afb9d3f90b959361681cfe06 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Sun, 11 Jun 2017 10:17:35 -0400 Subject: [PATCH 1/2] Slightly more succint sfinae expressions --- include/boost/core/addressof.hpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/include/boost/core/addressof.hpp b/include/boost/core/addressof.hpp index b73ea56..733a606 100644 --- a/include/boost/core/addressof.hpp +++ b/include/boost/core/addressof.hpp @@ -172,19 +172,14 @@ namespace detail { template T addressof_declval() BOOST_NOEXCEPT; -template -struct addressof_void { - typedef void type; -}; - template struct addressof_member_operator { static constexpr bool value = false; }; template -struct addressof_member_operator().operator&())>::type> { +struct addressof_member_operator().operator&(), void())> { static constexpr bool value = true; }; @@ -201,8 +196,8 @@ struct addressof_non_member_operator { }; template -struct addressof_non_member_operator()))>::type> { +struct addressof_non_member_operator()), void())> { static constexpr bool value = true; }; @@ -213,7 +208,7 @@ struct addressof_expression { template struct addressof_expression())>::type> { + decltype(&addressof_declval(), void())> { static constexpr bool value = true; }; From cccac1d631b5388f560c9b9e302d1f972c41422a Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Sun, 11 Jun 2017 10:53:28 -0400 Subject: [PATCH 2/2] Revert "Slightly more succint sfinae expressions" --- include/boost/core/addressof.hpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/include/boost/core/addressof.hpp b/include/boost/core/addressof.hpp index 733a606..b73ea56 100644 --- a/include/boost/core/addressof.hpp +++ b/include/boost/core/addressof.hpp @@ -172,14 +172,19 @@ namespace detail { template T addressof_declval() BOOST_NOEXCEPT; +template +struct addressof_void { + typedef void type; +}; + template struct addressof_member_operator { static constexpr bool value = false; }; template -struct addressof_member_operator().operator&(), void())> { +struct addressof_member_operator().operator&())>::type> { static constexpr bool value = true; }; @@ -196,8 +201,8 @@ struct addressof_non_member_operator { }; template -struct addressof_non_member_operator()), void())> { +struct addressof_non_member_operator()))>::type> { static constexpr bool value = true; }; @@ -208,7 +213,7 @@ struct addressof_expression { template struct addressof_expression(), void())> { + typename addressof_void())>::type> { static constexpr bool value = true; };