Skip to content

Commit

Permalink
Remove unnecessary uses of TypeTraits
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Apr 20, 2024
1 parent d4c79bf commit 81da635
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
7 changes: 3 additions & 4 deletions include/boost/uuid/detail/random_provider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
#include <boost/uuid/entropy_error.hpp>
#include <boost/uuid/detail/static_assert.hpp>
#include <boost/config.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_unsigned.hpp>
#include <iterator>
#include <type_traits>
#include <limits>
#include <cstdint>
#include <climits>
Expand Down Expand Up @@ -55,8 +54,8 @@ class random_provider :
void generate(Iter first, Iter last)
{
typedef typename std::iterator_traits<Iter>::value_type value_type;
BOOST_UUID_STATIC_ASSERT(is_integral<value_type>::value);
BOOST_UUID_STATIC_ASSERT(is_unsigned<value_type>::value);
BOOST_UUID_STATIC_ASSERT(std::is_integral<value_type>::value);
BOOST_UUID_STATIC_ASSERT(std::is_unsigned<value_type>::value);
BOOST_UUID_STATIC_ASSERT(sizeof(value_type) * CHAR_BIT >= 32);

for (; first != last; ++first)
Expand Down
18 changes: 0 additions & 18 deletions include/boost/uuid/uuid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@
#include <boost/uuid/detail/config.hpp>
#include <cstddef>
#include <cstdint>
#ifndef BOOST_UUID_NO_TYPE_TRAITS
#include <boost/type_traits/is_pod.hpp>
#include <boost/type_traits/integral_constant.hpp>
#endif

#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif

#if defined(_MSC_VER)
#pragma warning(push) // Save warning settings.
Expand Down Expand Up @@ -182,16 +174,6 @@ inline std::size_t hash_value(uuid const& u) BOOST_NOEXCEPT

}} //namespace boost::uuids

#ifndef BOOST_UUID_NO_TYPE_TRAITS
// type traits specializations
namespace boost {

template <>
struct is_pod<uuids::uuid> : true_type {};

} // namespace boost
#endif

#if defined(BOOST_UUID_USE_SSE2)
#include <boost/uuid/detail/uuid_x86.ipp>
#else
Expand Down
2 changes: 1 addition & 1 deletion test/test_uuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ int main(int, char*[])
}

{ // test is_pod
BOOST_TEST_EQ(boost::is_pod<uuid>::value, true);
BOOST_TEST_EQ(std::is_pod<uuid>::value, true);
}

return boost::report_errors();
Expand Down

0 comments on commit 81da635

Please sign in to comment.