From b72dbef1a93a9649c7a2dd74f8551e94248cdf3d Mon Sep 17 00:00:00 2001 From: joaquintides Date: Thu, 4 May 2023 18:51:03 +0200 Subject: [PATCH] added equality comparison to reference --- doc/unordered/concurrent_flat_map.adoc | 65 +++++++++++++++++++++----- 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/doc/unordered/concurrent_flat_map.adoc b/doc/unordered/concurrent_flat_map.adoc index 7adb2323..c3222ab0 100644 --- a/doc/unordered/concurrent_flat_map.adoc +++ b/doc/unordered/concurrent_flat_map.adoc @@ -214,39 +214,39 @@ namespace boost { class Pred = std::equal_to>, class Allocator = std::allocator>> concurrent_flat_map(InputIterator, InputIterator, typename xref:#concurrent_flat_map_deduction_guides[__see below__]::size_type = xref:#concurrent_flat_map_deduction_guides[__see below__], - Hash = Hash(), Pred = Pred(), Allocator = Allocator()) + Hash = Hash(), Pred = Pred(), Allocator = Allocator()) -> concurrent_flat_map, xref:#concurrent_flat_map_iter_mapped_type[__iter-mapped-type__], Hash, - Pred, Allocator>; + Pred, Allocator>; template, class Pred = std::equal_to, class Allocator = std::allocator>> concurrent_flat_map(std::initializer_list>, - typename xref:#concurrent_flat_map_deduction_guides[__see below__]::size_type = xref:#concurrent_flat_map_deduction_guides[__see below__], Hash = Hash(), - Pred = Pred(), Allocator = Allocator()) + typename xref:#concurrent_flat_map_deduction_guides[__see below__]::size_type = xref:#concurrent_flat_map_deduction_guides[__see below__], Hash = Hash(), + Pred = Pred(), Allocator = Allocator()) -> concurrent_flat_map; template concurrent_flat_map(InputIterator, InputIterator, typename xref:#concurrent_flat_map_deduction_guides[__see below__]::size_type, Allocator) -> concurrent_flat_map, xref:#concurrent_flat_map_iter_mapped_type[__iter-mapped-type__], - boost::hash>, - std::equal_to>, Allocator>; + boost::hash>, + std::equal_to>, Allocator>; template concurrent_flat_map(InputIterator, InputIterator, Allocator) -> concurrent_flat_map, xref:#concurrent_flat_map_iter_mapped_type[__iter-mapped-type__], - boost::hash>, - std::equal_to>, Allocator>; + boost::hash>, + std::equal_to>, Allocator>; template concurrent_flat_map(InputIterator, InputIterator, typename xref:#concurrent_flat_map_deduction_guides[__see below__]::size_type, Hash, - Allocator) + Allocator) -> concurrent_flat_map, xref:#concurrent_flat_map_iter_mapped_type[__iter-mapped-type__], Hash, - std::equal_to>, Allocator>; + std::equal_to>, Allocator>; template concurrent_flat_map(std::initializer_list>, typename xref:#concurrent_flat_map_deduction_guides[__see below__]::size_type, - Allocator) + Allocator) -> concurrent_flat_map, std::equal_to, Allocator>; template @@ -255,9 +255,18 @@ namespace boost { template concurrent_flat_map(std::initializer_list>, typename xref:#concurrent_flat_map_deduction_guides[__see below__]::size_type, - Hash, Allocator) + Hash, Allocator) -> concurrent_flat_map, Allocator>; + // Equality Comparisons + template + bool xref:#concurrent_flat_map_operator[operator==](const concurrent_flat_map& x, + const concurrent_flat_map& y); + + template + bool xref:#concurrent_flat_map_operator_2[operator!=](const concurrent_flat_map& x, + const concurrent_flat_map& y); + // swap template void xref:#concurrent_flat_map_swap_2[swap](concurrent_flat_map& x, @@ -1339,6 +1348,38 @@ template std::tuple_element_t<1, xref:#concurrent_map_iter_value_type[__iter-value-type__]>>; // exposition only ----- +=== Equality Comparisons + +==== operator== +```c++ +template + bool operator==(const concurrent_flat_map& x, + const concurrent_flat_map& y); +``` + +Returns `true` if `x.size() == y.size()` and for every element in `x`, there is an element in `y` with the same key, with an equal value (using `operator==` to compare the value types). + +[horizontal] +Concurrency:;; Blocking on `x` and `y`. +Notes:;; Behavior is undefined if the two tables don't have equivalent equality predicates. + +--- + +==== operator!= +```c++ +template + bool operator!=(const concurrent_flat_map& x, + const concurrent_flat_map& y); +``` + +Returns `false` if `x.size() == y.size()` and for every element in `x`, there is an element in `y` with the same key, with an equal value (using `operator==` to compare the value types). + +[horizontal] +Concurrency:;; Blocking on `x` and `y`. +Notes:;; Behavior is undefined if the two tables don't have equivalent equality predicates. + +--- + === Swap ```c++ template