From 7c12b20f7790f94fc6203007aba57e19954d6c31 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 7 Dec 2023 17:38:59 +0200 Subject: [PATCH] Remove underlying_type.hpp --- include/boost/hash2/underlying_type.hpp | 20 ---- test/Jamfile | 1 - test/underlying_type.cpp | 130 ------------------------ 3 files changed, 151 deletions(-) delete mode 100644 include/boost/hash2/underlying_type.hpp delete mode 100644 test/underlying_type.cpp diff --git a/include/boost/hash2/underlying_type.hpp b/include/boost/hash2/underlying_type.hpp deleted file mode 100644 index 081eb4f..0000000 --- a/include/boost/hash2/underlying_type.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef BOOST_HASH2_UNDERLYING_TYPE_HPP_INCLUDED -#define BOOST_HASH2_UNDERLYING_TYPE_HPP_INCLUDED - -// Copyright 2017, 2018 Peter Dimov. -// Distributed under the Boost Software License, Version 1.0. -// https://www.boost.org/LICENSE_1_0.txt - -#include - -namespace boost -{ -namespace hash2 -{ - -using std::underlying_type; - -} // namespace hash2 -} // namespace boost - -#endif // #ifndef BOOST_HASH2_UNDERLYING_TYPE_HPP_INCLUDED diff --git a/test/Jamfile b/test/Jamfile index 3a89b4d..f6ca5fd 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -11,7 +11,6 @@ run is_range.cpp ; run is_contiguous_range.cpp ; run is_unordered_range.cpp ; run is_tuple_like.cpp ; -run underlying_type.cpp ; run endian.cpp ; # helpers diff --git a/test/underlying_type.cpp b/test/underlying_type.cpp deleted file mode 100644 index 4849ada..0000000 --- a/test/underlying_type.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2017, 2018 Peter Dimov. -// Distributed under the Boost Software License, Version 1.0. -// https://www.boost.org/LICENSE_1_0.txt - -#include -#include -#include -#include -#include - -enum E1 -{ - e1 -}; - -enum E2 -{ - e2 = SCHAR_MAX -}; - -enum E3 -{ - e3 = SCHAR_MIN -}; - -enum E4 -{ - e4 = UCHAR_MAX -}; - -enum E5 -{ - e5 = SHRT_MAX -}; - -enum E6 -{ - e6 = SHRT_MIN -}; - -enum E7 -{ - e7 = USHRT_MAX -}; - -enum E8 -{ - e8 = INT_MAX -}; - -enum E9 -{ - e9 = INT_MIN -}; - -enum E10 -{ - e10 = UINT_MAX -}; - -enum E11 -{ - e11 = LONG_MAX -}; - -enum E12 -{ - e12 = LONG_MIN -}; - -enum E13 -{ - e13 = ULONG_MAX -}; - -enum E14 -{ - e14 = LLONG_MAX -}; - -enum E15 -{ - e15 = LLONG_MIN -}; - -enum E16 -{ - e16 = ULLONG_MAX -}; - -template void test( E e ) -{ - typedef typename boost::hash2::underlying_type::type U; - - BOOST_TEST_TRAIT_TRUE(( std::is_enum )); - BOOST_TEST_TRAIT_TRUE(( std::is_integral )); - - BOOST_TEST_EQ( sizeof(E), sizeof(U) ); - - U u = static_cast( e ); - - BOOST_TEST_EQ( u, e ); - - unsigned char const * pe = reinterpret_cast( &e ); - unsigned char const * pu = reinterpret_cast( &u ); - - BOOST_TEST_ALL_EQ( pe, pe + sizeof( e ), pu, pu + sizeof( u ) ); -} - -int main() -{ - test( e1 ); - test( e2 ); - test( e3 ); - test( e4 ); - test( e5 ); - test( e6 ); - test( e7 ); - test( e8 ); - test( e9 ); - test( e10 ); - test( e11 ); - test( e12 ); - test( e13 ); - test( e14 ); - test( e15 ); - test( e16 ); - - return boost::report_errors(); -}