diff --git a/include/boost/unordered/detail/foa/concurrent_table.hpp b/include/boost/unordered/detail/foa/concurrent_table.hpp index 11c7bb39..722baf47 100644 --- a/include/boost/unordered/detail/foa/concurrent_table.hpp +++ b/include/boost/unordered/detail/foa/concurrent_table.hpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -28,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -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 struct atomic_size_control { static constexpr auto atomic_size_t_size=sizeof(std::atomic); - BOOST_STATIC_ASSERT(atomic_size_t_size #include #include -#include #include #include #include #include #include #include +#include #include #include #include @@ -311,7 +311,7 @@ struct group15 private: using slot_type=IntegralWrapper; - 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; - 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; - BOOST_STATIC_ASSERT(sizeof(word_type)==8); + BOOST_UNORDERED_STATIC_ASSERT(sizeof(word_type)==8); static constexpr unsigned char available_=0, sentinel_=1; diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index e44471b2..6876a57d 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -2132,7 +2133,7 @@ namespace boost { void merge_unique(boost::unordered::detail::table& other) { typedef boost::unordered::detail::table other_table; - BOOST_STATIC_ASSERT(( + BOOST_UNORDERED_STATIC_ASSERT(( boost::is_same::value)); BOOST_ASSERT(this->node_alloc() == other.node_alloc()); diff --git a/include/boost/unordered/detail/narrow_cast.hpp b/include/boost/unordered/detail/narrow_cast.hpp index 8fb7f304..523f6e4a 100644 --- a/include/boost/unordered/detail/narrow_cast.hpp +++ b/include/boost/unordered/detail/narrow_cast.hpp @@ -9,8 +9,9 @@ #ifndef BOOST_UNORDERED_DETAIL_NARROW_CAST_HPP #define BOOST_UNORDERED_DETAIL_NARROW_CAST_HPP +#include + #include -#include #include #include @@ -21,9 +22,9 @@ namespace detail{ template constexpr To narrow_cast(From x) noexcept { - BOOST_STATIC_ASSERT(boost::is_integral::value); - BOOST_STATIC_ASSERT(boost::is_integral::value); - BOOST_STATIC_ASSERT(sizeof(From)>=sizeof(To)); + BOOST_UNORDERED_STATIC_ASSERT(boost::is_integral::value); + BOOST_UNORDERED_STATIC_ASSERT(boost::is_integral::value); + BOOST_UNORDERED_STATIC_ASSERT(sizeof(From)>=sizeof(To)); return static_cast( x diff --git a/include/boost/unordered/detail/static_assert.hpp b/include/boost/unordered/detail/static_assert.hpp new file mode 100644 index 00000000..2e91dbe7 --- /dev/null +++ b/include/boost/unordered/detail/static_assert.hpp @@ -0,0 +1,12 @@ +#ifndef BOOST_UNORDERED_DETAIL_STATIC_ASSERT_HPP +#define BOOST_UNORDERED_DETAIL_STATIC_ASSERT_HPP + +#include +#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 \ No newline at end of file