From c8479b4eca146ea01717b3be3020cc6c21c66f63 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Tue, 7 Dec 2021 21:08:04 -0500 Subject: [PATCH] Simplify C++03 detection traits slightly --- include/boost/core/allocator_access.hpp | 47 +++++++------------------ 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/include/boost/core/allocator_access.hpp b/include/boost/core/allocator_access.hpp index 6a64c0b..ab5363a 100644 --- a/include/boost/core/allocator_access.hpp +++ b/include/boost/core/allocator_access.hpp @@ -547,31 +547,25 @@ allocator_destroy(A&, T* p) namespace detail { #if defined(BOOST_NO_CXX11_ALLOCATOR) -template::type(A::*)()> -struct alloc_max_size { - char one, two; -}; - -template::type(A::*)() const> -struct alloc_max_size_const { - char one, two; -}; - -template::type(*)()> -struct alloc_max_size_static { - char one, two; +template +struct alloc_no { + char x; + char y; }; template class alloc_has_max_size { template - static alloc_max_size check(int); + static alloc_no::type(O::*)(), + &O::max_size> check(int); template - static alloc_max_size_const check(int); + static alloc_no::type(O::*)() const, + &O::max_size> check(int); template - static alloc_max_size_static check(int); + static alloc_no::type(*)(), + &O::max_size> check(int); template static char check(long); @@ -625,33 +619,18 @@ allocator_max_size(const A&) BOOST_NOEXCEPT namespace detail { #if defined(BOOST_NO_CXX11_ALLOCATOR) -template -struct alloc_soccc { - char one, two; -}; - -template -struct alloc_soccc_const { - char one, two; -}; - -template -struct alloc_soccc_static { - char one, two; -}; - template class alloc_has_soccc { template - static alloc_soccc + static alloc_no check(int); template - static alloc_soccc_const + static alloc_no check(int); template - static alloc_soccc_static + static alloc_no check(int); template