mirror of
https://github.com/boostorg/unordered.git
synced 2025-05-11 13:34:06 +00:00
Remove Boost.StaticAssert
This commit is contained in:
parent
15318f0e46
commit
d881d4d5e2
@ -19,7 +19,6 @@
|
||||
#include <boost/core/serialization.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/mp11/tuple.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/unordered/detail/archive_constructed.hpp>
|
||||
#include <boost/unordered/detail/bad_archive_exception.hpp>
|
||||
@ -28,6 +27,7 @@
|
||||
#include <boost/unordered/detail/foa/rw_spinlock.hpp>
|
||||
#include <boost/unordered/detail/foa/tuple_rotate_right.hpp>
|
||||
#include <boost/unordered/detail/serialization_version.hpp>
|
||||
#include <boost/unordered/detail/static_assert.hpp>
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
#include <initializer_list>
|
||||
@ -88,7 +88,7 @@ private:
|
||||
static constexpr std::size_t element_offset=
|
||||
(sizeof(T)+cacheline_size-1)/cacheline_size*cacheline_size;
|
||||
|
||||
BOOST_STATIC_ASSERT(alignof(T)<=cacheline_size);
|
||||
BOOST_UNORDERED_STATIC_ASSERT(alignof(T)<=cacheline_size);
|
||||
|
||||
T* data(std::size_t pos)noexcept
|
||||
{
|
||||
@ -341,7 +341,7 @@ struct concurrent_table_arrays:table_arrays<Value,Group,SizePolicy,Allocator>
|
||||
struct atomic_size_control
|
||||
{
|
||||
static constexpr auto atomic_size_t_size=sizeof(std::atomic<std::size_t>);
|
||||
BOOST_STATIC_ASSERT(atomic_size_t_size<cacheline_size);
|
||||
BOOST_UNORDERED_STATIC_ASSERT(atomic_size_t_size<cacheline_size);
|
||||
|
||||
atomic_size_control(std::size_t ml_,std::size_t size_):
|
||||
pad0_{},ml{ml_},pad1_{},size{size_}{}
|
||||
|
@ -22,13 +22,13 @@
|
||||
#include <boost/core/pointer_traits.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/predef.h>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/has_trivial_constructor.hpp>
|
||||
#include <boost/type_traits/has_trivial_copy.hpp>
|
||||
#include <boost/type_traits/has_trivial_assign.hpp>
|
||||
#include <boost/type_traits/is_nothrow_swappable.hpp>
|
||||
#include <boost/unordered/detail/narrow_cast.hpp>
|
||||
#include <boost/unordered/detail/mulx.hpp>
|
||||
#include <boost/unordered/detail/static_assert.hpp>
|
||||
#include <boost/unordered/hash_traits.hpp>
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
@ -311,7 +311,7 @@ struct group15
|
||||
|
||||
private:
|
||||
using slot_type=IntegralWrapper<unsigned char>;
|
||||
BOOST_STATIC_ASSERT(sizeof(slot_type)==1);
|
||||
BOOST_UNORDERED_STATIC_ASSERT(sizeof(slot_type)==1);
|
||||
|
||||
static constexpr unsigned char available_=0,
|
||||
sentinel_=1;
|
||||
@ -514,7 +514,7 @@ struct group15
|
||||
|
||||
private:
|
||||
using slot_type=IntegralWrapper<unsigned char>;
|
||||
BOOST_STATIC_ASSERT(sizeof(slot_type)==1);
|
||||
BOOST_UNORDERED_STATIC_ASSERT(sizeof(slot_type)==1);
|
||||
|
||||
static constexpr unsigned char available_=0,
|
||||
sentinel_=1;
|
||||
@ -707,7 +707,7 @@ struct group15
|
||||
|
||||
private:
|
||||
using word_type=IntegralWrapper<uint64_t>;
|
||||
BOOST_STATIC_ASSERT(sizeof(word_type)==8);
|
||||
BOOST_UNORDERED_STATIC_ASSERT(sizeof(word_type)==8);
|
||||
|
||||
static constexpr unsigned char available_=0,
|
||||
sentinel_=1;
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <boost/unordered/detail/fca.hpp>
|
||||
#include <boost/unordered/detail/fwd.hpp>
|
||||
#include <boost/unordered/detail/serialize_tracked_address.hpp>
|
||||
#include <boost/unordered/detail/static_assert.hpp>
|
||||
#include <boost/unordered/detail/type_traits.hpp>
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
@ -2132,7 +2133,7 @@ namespace boost {
|
||||
void merge_unique(boost::unordered::detail::table<Types2>& other)
|
||||
{
|
||||
typedef boost::unordered::detail::table<Types2> other_table;
|
||||
BOOST_STATIC_ASSERT((
|
||||
BOOST_UNORDERED_STATIC_ASSERT((
|
||||
boost::is_same<node_type, typename other_table::node_type>::value));
|
||||
BOOST_ASSERT(this->node_alloc() == other.node_alloc());
|
||||
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef BOOST_UNORDERED_DETAIL_NARROW_CAST_HPP
|
||||
#define BOOST_UNORDERED_DETAIL_NARROW_CAST_HPP
|
||||
|
||||
#include <boost/unordered/detail/static_assert.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
|
||||
@ -21,9 +22,9 @@ namespace detail{
|
||||
template<typename To,typename From>
|
||||
constexpr To narrow_cast(From x) noexcept
|
||||
{
|
||||
BOOST_STATIC_ASSERT(boost::is_integral<From>::value);
|
||||
BOOST_STATIC_ASSERT(boost::is_integral<To>::value);
|
||||
BOOST_STATIC_ASSERT(sizeof(From)>=sizeof(To));
|
||||
BOOST_UNORDERED_STATIC_ASSERT(boost::is_integral<From>::value);
|
||||
BOOST_UNORDERED_STATIC_ASSERT(boost::is_integral<To>::value);
|
||||
BOOST_UNORDERED_STATIC_ASSERT(sizeof(From)>=sizeof(To));
|
||||
|
||||
return static_cast<To>(
|
||||
x
|
||||
|
12
include/boost/unordered/detail/static_assert.hpp
Normal file
12
include/boost/unordered/detail/static_assert.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef BOOST_UNORDERED_DETAIL_STATIC_ASSERT_HPP
|
||||
#define BOOST_UNORDERED_DETAIL_STATIC_ASSERT_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#define BOOST_UNORDERED_STATIC_ASSERT(...) \
|
||||
static_assert(__VA_ARGS__, #__VA_ARGS__)
|
||||
|
||||
#endif // BOOST_UNORDERED_DETAIL_STATIC_ASSERT_HPP
|
Loading…
x
Reference in New Issue
Block a user