forked from boostorg/unordered
refactored dummy_groups
This commit is contained in:
@ -15,13 +15,14 @@
|
|||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/core/bit.hpp>
|
#include <boost/core/bit.hpp>
|
||||||
#include <boost/core/no_exceptions_support.hpp>
|
#include <boost/core/no_exceptions_support.hpp>
|
||||||
|
#include <boost/core/pointer_traits.hpp>
|
||||||
#include <boost/cstdint.hpp>
|
#include <boost/cstdint.hpp>
|
||||||
#include <boost/predef.h>
|
#include <boost/predef.h>
|
||||||
#include <boost/type_traits/is_nothrow_swappable.hpp>
|
#include <boost/type_traits/is_nothrow_swappable.hpp>
|
||||||
#include <cstddef>
|
|
||||||
#include <cstring>
|
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <cstddef>
|
||||||
|
#include <cstring>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -137,6 +138,9 @@ struct group15
|
|||||||
return at(N-1)==sentinel_?match_occupied()&0x3FFF:match_occupied();
|
return at(N-1)==sentinel_?match_occupied()&0x3FFF:match_occupied();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static constexpr struct{alignas(16) unsigned char storage[N+1];} dummy_group=
|
||||||
|
{{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr unsigned char available_=0,
|
static constexpr unsigned char available_=0,
|
||||||
sentinel_=1;
|
sentinel_=1;
|
||||||
@ -691,22 +695,14 @@ private:
|
|||||||
|
|
||||||
static group_type* dummy_groups()noexcept
|
static group_type* dummy_groups()noexcept
|
||||||
{
|
{
|
||||||
#if defined(BOOST_UNORDERED_SSE2)
|
using dummy_group_layout=
|
||||||
static_assert(
|
typename std::remove_const<decltype(group_type::dummy_group)>::type;
|
||||||
std::is_same<group_type,group15>::value,
|
|
||||||
"encapsulation breach"
|
|
||||||
);
|
|
||||||
alignas(group_type) static constexpr unsigned char
|
|
||||||
storage[sizeof(group_type)*2]={
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
|
|
||||||
};
|
|
||||||
|
|
||||||
return reinterpret_cast<group_type*>(const_cast<unsigned char*>(storage));
|
static constexpr dummy_group_layout
|
||||||
|
storage[2]={group_type::dummy_group,group_type::dummy_group};
|
||||||
|
|
||||||
|
return reinterpret_cast<group_type*>(const_cast<dummy_group_layout*>(storage));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#error encapsulation breach
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void delete_arrays(const arrays_info& arrays_)noexcept
|
void delete_arrays(const arrays_info& arrays_)noexcept
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user