From 587929edf67fabc8397cac970db5cd6bfcb02144 Mon Sep 17 00:00:00 2001 From: Damian Jarek Date: Wed, 28 Nov 2018 14:35:26 +0100 Subject: [PATCH] Remove unused type_traits close #1337 Signed-off-by: Damian Jarek --- CHANGELOG.md | 1 + .../boost/beast/core/detail/type_traits.hpp | 80 ------------------- test/beast/core/type_traits.cpp | 23 ------ 3 files changed, 1 insertion(+), 103 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3c12f26..3ce331d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ Version 196: * Tidy up calls to placement new +* Remove unused type_traits -------------------------------------------------------------------------------- diff --git a/include/boost/beast/core/detail/type_traits.hpp b/include/boost/beast/core/detail/type_traits.hpp index c09a2d49..59488f13 100644 --- a/include/boost/beast/core/detail/type_traits.hpp +++ b/include/boost/beast/core/detail/type_traits.hpp @@ -150,86 +150,6 @@ struct is_contiguous_container -struct unwidest_unsigned; - -template -struct unwidest_unsigned -{ - using type = U0; -}; - -template -struct unwidest_unsigned -{ - BOOST_STATIC_ASSERT(std::is_unsigned::value); - using type = typename std::conditional< - (sizeof(U0) < sizeof(typename unwidest_unsigned::type)), - U0, typename unwidest_unsigned::type>::type; -}; - -template -struct widest_unsigned; - -template -struct widest_unsigned -{ - using type = U0; -}; - -template -struct widest_unsigned -{ - BOOST_STATIC_ASSERT(std::is_unsigned::value); - using type = typename std::conditional< - (sizeof(U0) > sizeof(typename widest_unsigned::type)), - U0, typename widest_unsigned::type>::type; -}; - -template -inline -constexpr -U -min_all(U u) -{ - BOOST_STATIC_ASSERT(std::is_unsigned::value); - return u; -} - -template -inline -constexpr -typename unwidest_unsigned::type -min_all(U0 u0, U1 u1, UN... un) -{ - using type = - typename unwidest_unsigned::type; - return u0 < u1 ? - static_cast(min_all(u0, un...)) : - static_cast(min_all(u1, un...)); -} - -template -inline -constexpr -U -max_all(U u) -{ - BOOST_STATIC_ASSERT(std::is_unsigned::value); - return u; -} - -template -inline -constexpr -typename widest_unsigned::type -max_all(U0 u0, U1 u1, UN... un) -{ - return u0 > u1? max_all(u0, un...) : max_all(u1, un...); -} - -//------------------------------------------------------------------------------ - template struct get_lowest_layer_helper { diff --git a/test/beast/core/type_traits.cpp b/test/beast/core/type_traits.cpp index 3f1a9905..9ca2c0e1 100644 --- a/test/beast/core/type_traits.cpp +++ b/test/beast/core/type_traits.cpp @@ -93,29 +93,6 @@ BOOST_STATIC_ASSERT(std::is_same>, F2>::value); BOOST_STATIC_ASSERT(std::is_same>>, F1>::value); BOOST_STATIC_ASSERT(std::is_same>>, F2>::value); -// -// min_all, max_all -// - -BOOST_STATIC_ASSERT(std::is_same::type>::value); -BOOST_STATIC_ASSERT(std::is_same::type>::value); -BOOST_STATIC_ASSERT(! std::is_same::type>::value); -BOOST_STATIC_ASSERT(std::is_same::type>::value); -BOOST_STATIC_ASSERT(std::is_same::type>::value); -BOOST_STATIC_ASSERT(! std::is_same::type>::value); -BOOST_STATIC_ASSERT(max_all(1u) == 1); -BOOST_STATIC_ASSERT(max_all(1u, 2u) == 2); -BOOST_STATIC_ASSERT(max_all(1u, 2u, static_cast(3)) == 3); -BOOST_STATIC_ASSERT(min_all(1u) == 1); -BOOST_STATIC_ASSERT(min_all(1u, 2u) == 1); -BOOST_STATIC_ASSERT(min_all(1u, 2u, static_cast(3)) == 1); - } // (anonymous) } // detail