Add compile_set tests with stub for merge()

This commit is contained in:
Christian Mazakas
2022-10-11 15:20:37 -07:00
parent ccd40d0c44
commit 4a8d687778
5 changed files with 209 additions and 9 deletions

View File

@@ -618,10 +618,13 @@ class table_iterator
{
public:
using difference_type=std::ptrdiff_t;
using value_type=typename std::conditional<Const,const Value,Value>::type;
using pointer=value_type*;
using value_type=Value;
using pointer=
typename std::conditional<Const,value_type const*,value_type*>::type;
using reference=value_type&;
using iterator_category=std::forward_iterator_tag;
using element_type=
typename std::conditional<Const,value_type const,value_type>::type;
table_iterator()=default;
template<bool Const2,typename std::enable_if<!Const2>::type* =nullptr>
@@ -746,10 +749,12 @@ struct table_arrays
static void delete_(Allocator& al,table_arrays& arrays)noexcept
{
using alloc_traits=boost::allocator_traits<Allocator>;
using pointer=typename alloc_traits::pointer;
using pointer_traits=boost::pointer_traits<pointer>;
if(arrays.elements){
alloc_traits::deallocate(
al,arrays.elements,buffer_size(arrays.groups_size_mask+1));
al,pointer_traits::pointer_to(*arrays.elements),buffer_size(arrays.groups_size_mask+1));
}
}
@@ -981,7 +986,7 @@ public:
static constexpr auto pocca=
alloc_traits::propagate_on_container_copy_assignment::value;
if(this!=&x){
if(this!=std::addressof(x)){
clear();
h()=x.h();
pred()=x.pred();
@@ -1025,7 +1030,7 @@ public:
unchecked_insert(type_policy::move(*p));
};
if(this!=&x){
if(this!=std::addressof(x)){
clear();
h()=std::move(x.h());
pred()=std::move(x.pred());

View File

@@ -46,6 +46,7 @@ namespace boost {
using key_type = Key;
using value_type = typename set_types::value_type;
using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
using hasher = Hash;
using key_equal = KeyEqual;
using allocator_type = Allocator;
@@ -68,6 +69,11 @@ namespace boost {
{
}
unordered_flat_set(size_type n, hasher const& h, allocator_type const& a)
: unordered_flat_set(n, h, key_equal(), a)
{
}
explicit unordered_flat_set(allocator_type const& a)
: unordered_flat_set(0, a)
{
@@ -82,6 +88,20 @@ namespace boost {
this->insert(first, last);
}
template <class InputIt>
unordered_flat_set(
InputIt first, InputIt last, size_type n, allocator_type const& a)
: unordered_flat_set(first, last, n, hasher(), key_equal(), a)
{
}
template <class Iterator>
unordered_flat_set(Iterator first, Iterator last, size_type n,
hasher const& h, allocator_type const& a)
: unordered_flat_set(first, last, n, h, key_equal(), a)
{
}
unordered_flat_set(unordered_flat_set const& other) : table_(other.table_)
{
}
@@ -113,6 +133,18 @@ namespace boost {
{
}
unordered_flat_set(std::initializer_list<value_type> init, size_type n,
allocator_type const& a)
: unordered_flat_set(init, n, hasher(), key_equal(), a)
{
}
unordered_flat_set(std::initializer_list<value_type> init, size_type n,
hasher const& h, allocator_type const& a)
: unordered_flat_set(init, n, h, key_equal(), a)
{
}
~unordered_flat_set() = default;
unordered_flat_set& operator=(unordered_flat_set const& other)
@@ -154,6 +186,8 @@ namespace boost {
size_type size() const noexcept { return table_.size(); }
size_type max_size() const noexcept { return table_.max_size(); }
/// Modifiers
///
@@ -229,6 +263,18 @@ namespace boost {
table_.swap(rhs.table_);
}
template <class H2, class P2>
void merge(unordered_flat_set<key_type, H2, P2, allocator_type>& source)
{
(void) source;
}
template <class H2, class P2>
void merge(unordered_flat_set<key_type, H2, P2, allocator_type>&& source)
{
(void) source;
}
/// Lookup
///