From a461d5f0a3f7b1844ef84591826cf5c1065cc11c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 30 Jan 2023 19:10:43 -0800 Subject: Don't try to use std::pointer_traits::to_address --- common/almalloc.h | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/common/almalloc.h b/common/almalloc.h index 270cd76c..a795fc3b 100644 --- a/common/almalloc.h +++ b/common/almalloc.h @@ -108,21 +108,6 @@ template constexpr bool operator!=(const allocator&, const allocator&) noexcept { return false; } -namespace detail_ { - template - using void_t = void; - - template - struct has_to_address_ : public std::false_type { }; - template - struct has_to_address_::to_address(std::declval()))>> - : public std::true_type - { }; - template - constexpr bool has_to_address = has_to_address_::value; -} // namespace detail_ - template constexpr T *to_address(T *p) noexcept { @@ -130,12 +115,8 @@ constexpr T *to_address(T *p) noexcept return p; } -template,bool> = true> -constexpr auto to_address(const T& p) noexcept -{ return std::pointer_traits::to_address(p); } - -template,bool> = true> -constexpr auto to_address(const T& p) noexcept +template +constexpr auto to_address(const T &p) noexcept { return to_address(p.operator->()); } -- cgit v1.2.3