Remove unused type_traits

close #1337

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
Damian Jarek
2018-11-28 14:35:26 +01:00
committed by Vinnie Falco
parent b3a8e6edb5
commit 587929edf6
3 changed files with 1 additions and 103 deletions

View File

@@ -1,6 +1,7 @@
Version 196:
* Tidy up calls to placement new
* Remove unused type_traits
--------------------------------------------------------------------------------

View File

@@ -150,86 +150,6 @@ struct is_contiguous_container<T, E, void_t<
//------------------------------------------------------------------------------
template<class...>
struct unwidest_unsigned;
template<class U0>
struct unwidest_unsigned<U0>
{
using type = U0;
};
template<class U0, class... UN>
struct unwidest_unsigned<U0, UN...>
{
BOOST_STATIC_ASSERT(std::is_unsigned<U0>::value);
using type = typename std::conditional<
(sizeof(U0) < sizeof(typename unwidest_unsigned<UN...>::type)),
U0, typename unwidest_unsigned<UN...>::type>::type;
};
template<class...>
struct widest_unsigned;
template<class U0>
struct widest_unsigned<U0>
{
using type = U0;
};
template<class U0, class... UN>
struct widest_unsigned<U0, UN...>
{
BOOST_STATIC_ASSERT(std::is_unsigned<U0>::value);
using type = typename std::conditional<
(sizeof(U0) > sizeof(typename widest_unsigned<UN...>::type)),
U0, typename widest_unsigned<UN...>::type>::type;
};
template<class U>
inline
constexpr
U
min_all(U u)
{
BOOST_STATIC_ASSERT(std::is_unsigned<U>::value);
return u;
}
template<class U0, class U1, class... UN>
inline
constexpr
typename unwidest_unsigned<U0, U1, UN...>::type
min_all(U0 u0, U1 u1, UN... un)
{
using type =
typename unwidest_unsigned<U0, U1, UN...>::type;
return u0 < u1 ?
static_cast<type>(min_all(u0, un...)) :
static_cast<type>(min_all(u1, un...));
}
template<class U>
inline
constexpr
U
max_all(U u)
{
BOOST_STATIC_ASSERT(std::is_unsigned<U>::value);
return u;
}
template<class U0, class U1, class... UN>
inline
constexpr
typename widest_unsigned<U0, U1, UN...>::type
max_all(U0 u0, U1 u1, UN... un)
{
return u0 > u1? max_all(u0, un...) : max_all(u1, un...);
}
//------------------------------------------------------------------------------
template<class T, class = void>
struct get_lowest_layer_helper
{

View File

@@ -93,29 +93,6 @@ BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F2>>, F2>::value);
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F3<F1>>>, F1>::value);
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F3<F2>>>, F2>::value);
//
// min_all, max_all
//
BOOST_STATIC_ASSERT(std::is_same<std::size_t,
widest_unsigned<unsigned short, std::size_t>::type>::value);
BOOST_STATIC_ASSERT(std::is_same<std::uint64_t,
widest_unsigned<unsigned short, std::uint32_t, std::uint64_t>::type>::value);
BOOST_STATIC_ASSERT(! std::is_same<std::uint64_t,
widest_unsigned<unsigned short, std::uint32_t>::type>::value);
BOOST_STATIC_ASSERT(std::is_same<unsigned short,
unwidest_unsigned<unsigned short, std::size_t>::type>::value);
BOOST_STATIC_ASSERT(std::is_same<unsigned short,
unwidest_unsigned<unsigned short, std::uint32_t, std::uint64_t>::type>::value);
BOOST_STATIC_ASSERT(! std::is_same<std::uint32_t,
unwidest_unsigned<unsigned short, std::uint32_t>::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<std::uint64_t>(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<std::uint64_t>(3)) == 1);
} // (anonymous)
} // detail