mirror of
https://github.com/boostorg/unordered.git
synced 2025-05-11 05:23:58 +00:00
Use std::ref instead of copying the function parameter… (#290)
* GHA: revise numerous CI jobs. Fix sanitizer on new kernel * Use std::ref instead of copying the function parameter in std::initializer_list overloads of insert_{or|and}_[c]visit * Reimplement detail::is_invocable * Update docs for std::ref(f) changes --------- Co-authored-by: sdarwin <samuel.d.darwin@gmail.com>
This commit is contained in:
parent
94ab2f0776
commit
e214ecdbd0
@ -19,6 +19,7 @@ visits the element if insertion did _not_ take place).
|
|||||||
* Added GDB pretty-printers for all containers and iterators. For a container with an allocator that uses fancy pointers, these only work if the proper pretty-printer is written for the fancy pointer type itself.
|
* Added GDB pretty-printers for all containers and iterators. For a container with an allocator that uses fancy pointers, these only work if the proper pretty-printer is written for the fancy pointer type itself.
|
||||||
* Fixed `std::initializer_list` assignment issues for open-addressing containers
|
* Fixed `std::initializer_list` assignment issues for open-addressing containers
|
||||||
({github-pr-url}/277[PR#277^]).
|
({github-pr-url}/277[PR#277^]).
|
||||||
|
* Allowed non-copyable callables to be passed to the `std::initializer_list` overloads of `insert_{and|or}_[c]visit` for concurrent containers, by internally passing a `std::reference_wrapper` of the callable to the iterator-pair overloads.
|
||||||
|
|
||||||
|
|
||||||
== Release 1.86.0
|
== Release 1.86.0
|
||||||
|
@ -1148,7 +1148,7 @@ template<class F> size_type insert_or_cvisit(std::initializer_list<value_type> i
|
|||||||
Equivalent to
|
Equivalent to
|
||||||
[listing,subs="+macros,+quotes"]
|
[listing,subs="+macros,+quotes"]
|
||||||
-----
|
-----
|
||||||
this->xref:#concurrent_flat_map_insert_iterator_range_or_visit[insert_or_[c\]visit](il.begin(), il.end(), f);
|
this->xref:#concurrent_flat_map_insert_iterator_range_or_visit[insert_or_[c\]visit](il.begin(), il.end(), std::ref(f));
|
||||||
-----
|
-----
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
@ -1246,15 +1246,15 @@ Returns:;; The number of elements inserted.
|
|||||||
==== Insert Initializer List and Visit
|
==== Insert Initializer List and Visit
|
||||||
```c++
|
```c++
|
||||||
template<class F1, class F2>
|
template<class F1, class F2>
|
||||||
size_type insert_or_visit(std::initializer_list<value_type> il, F1 f1, F2 f2);
|
size_type insert_and_visit(std::initializer_list<value_type> il, F1 f1, F2 f2);
|
||||||
template<class F1, class F2>
|
template<class F1, class F2>
|
||||||
size_type insert_or_cvisit(std::initializer_list<value_type> il, F1 f1, F2 f2);
|
size_type insert_and_cvisit(std::initializer_list<value_type> il, F1 f1, F2 f2);
|
||||||
```
|
```
|
||||||
|
|
||||||
Equivalent to
|
Equivalent to
|
||||||
[listing,subs="+macros,+quotes"]
|
[listing,subs="+macros,+quotes"]
|
||||||
-----
|
-----
|
||||||
this->xref:#concurrent_flat_map_insert_iterator_range_and_visit[insert_and_[c\]visit](il.begin(), il.end(), f1, f2);
|
this->xref:#concurrent_flat_map_insert_iterator_range_and_visit[insert_and_[c\]visit](il.begin(), il.end(), std::ref(f1), std::ref(f2));
|
||||||
-----
|
-----
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
|
@ -1106,7 +1106,7 @@ template<class F> size_type insert_or_cvisit(std::initializer_list<value_type> i
|
|||||||
Equivalent to
|
Equivalent to
|
||||||
[listing,subs="+macros,+quotes"]
|
[listing,subs="+macros,+quotes"]
|
||||||
-----
|
-----
|
||||||
this->xref:#concurrent_flat_set_insert_iterator_range_or_visit[insert_or_[c\]visit](il.begin(), il.end(), f);
|
this->xref:#concurrent_flat_set_insert_iterator_range_or_visit[insert_or_[c\]visit](il.begin(), il.end(), std::ref(f));
|
||||||
-----
|
-----
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
@ -1222,7 +1222,7 @@ template<class F1, class F2>
|
|||||||
Equivalent to
|
Equivalent to
|
||||||
[listing,subs="+macros,+quotes"]
|
[listing,subs="+macros,+quotes"]
|
||||||
-----
|
-----
|
||||||
this->xref:#concurrent_flat_set_insert_iterator_range_and_visit[insert_and_[c\]visit](il.begin(), il.end(), f1, f2);
|
this->xref:#concurrent_flat_set_insert_iterator_range_and_visit[insert_and_[c\]visit](il.begin(), il.end(), std::ref(f1), std::ref(f2));
|
||||||
-----
|
-----
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
|
@ -1207,7 +1207,7 @@ template<class F> size_type insert_or_cvisit(std::initializer_list<value_type> i
|
|||||||
Equivalent to
|
Equivalent to
|
||||||
[listing,subs="+macros,+quotes"]
|
[listing,subs="+macros,+quotes"]
|
||||||
-----
|
-----
|
||||||
this->xref:#concurrent_node_map_insert_iterator_range_or_visit[insert_or_[c\]visit](il.begin(), il.end(), f);
|
this->xref:#concurrent_node_map_insert_iterator_range_or_visit[insert_or_[c\]visit](il.begin(), il.end(), std::ref(f));
|
||||||
-----
|
-----
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
@ -1320,15 +1320,15 @@ Returns:;; The number of elements inserted.
|
|||||||
==== Insert Initializer List and Visit
|
==== Insert Initializer List and Visit
|
||||||
```c++
|
```c++
|
||||||
template<class F1, class F2>
|
template<class F1, class F2>
|
||||||
size_type insert_or_visit(std::initializer_list<value_type> il, F1 f1, F2 f2);
|
size_type insert_and_visit(std::initializer_list<value_type> il, F1 f1, F2 f2);
|
||||||
template<class F1, class F2>
|
template<class F1, class F2>
|
||||||
size_type insert_or_cvisit(std::initializer_list<value_type> il, F1 f1, F2 f2);
|
size_type insert_and_cvisit(std::initializer_list<value_type> il, F1 f1, F2 f2);
|
||||||
```
|
```
|
||||||
|
|
||||||
Equivalent to
|
Equivalent to
|
||||||
[listing,subs="+macros,+quotes"]
|
[listing,subs="+macros,+quotes"]
|
||||||
-----
|
-----
|
||||||
this->xref:#concurrent_node_map_insert_iterator_range_and_visit[insert_and_[c\]visit](il.begin(), il.end(), f1, f2);
|
this->xref:#concurrent_node_map_insert_iterator_range_and_visit[insert_and_[c\]visit](il.begin(), il.end(), std::ref(f1), std::ref(f2));
|
||||||
-----
|
-----
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
|
@ -1164,7 +1164,7 @@ template<class F> size_type insert_or_cvisit(std::initializer_list<value_type> i
|
|||||||
Equivalent to
|
Equivalent to
|
||||||
[listing,subs="+macros,+quotes"]
|
[listing,subs="+macros,+quotes"]
|
||||||
-----
|
-----
|
||||||
this->xref:#concurrent_node_set_insert_iterator_range_or_visit[insert_or_[c\]visit](il.begin(), il.end(), f);
|
this->xref:#concurrent_node_set_insert_iterator_range_or_visit[insert_or_[c\]visit](il.begin(), il.end(), std::ref(f));
|
||||||
-----
|
-----
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
@ -1295,7 +1295,7 @@ template<class F1, class F2>
|
|||||||
Equivalent to
|
Equivalent to
|
||||||
[listing,subs="+macros,+quotes"]
|
[listing,subs="+macros,+quotes"]
|
||||||
-----
|
-----
|
||||||
this->xref:#concurrent_node_set_insert_iterator_range_and_visit[insert_and_[c\]visit](il.begin(), il.end(), f1, f2);
|
this->xref:#concurrent_node_set_insert_iterator_range_and_visit[insert_and_[c\]visit](il.begin(), il.end(), std::ref(f1), std::ref(f2));
|
||||||
-----
|
-----
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
|
@ -487,7 +487,7 @@ namespace boost {
|
|||||||
size_type insert_or_visit(std::initializer_list<value_type> ilist, F f)
|
size_type insert_or_visit(std::initializer_list<value_type> ilist, F f)
|
||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F)
|
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F)
|
||||||
return this->insert_or_visit(ilist.begin(), ilist.end(), f);
|
return this->insert_or_visit(ilist.begin(), ilist.end(), std::ref(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Ty, class F>
|
template <class Ty, class F>
|
||||||
@ -520,7 +520,7 @@ namespace boost {
|
|||||||
size_type insert_or_cvisit(std::initializer_list<value_type> ilist, F f)
|
size_type insert_or_cvisit(std::initializer_list<value_type> ilist, F f)
|
||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
||||||
return this->insert_or_cvisit(ilist.begin(), ilist.end(), f);
|
return this->insert_or_cvisit(ilist.begin(), ilist.end(), std::ref(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Ty, class F1, class F2>
|
template <class Ty, class F1, class F2>
|
||||||
@ -559,7 +559,8 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F1)
|
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F1)
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F2)
|
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F2)
|
||||||
return this->insert_and_visit(ilist.begin(), ilist.end(), f1, f2);
|
return this->insert_and_visit(
|
||||||
|
ilist.begin(), ilist.end(), std::ref(f1), std::ref(f2));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Ty, class F1, class F2>
|
template <class Ty, class F1, class F2>
|
||||||
@ -598,7 +599,8 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F1)
|
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F1)
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
||||||
return this->insert_and_cvisit(ilist.begin(), ilist.end(), f1, f2);
|
return this->insert_and_cvisit(
|
||||||
|
ilist.begin(), ilist.end(), std::ref(f1), std::ref(f2));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class... Args> BOOST_FORCEINLINE bool emplace(Args&&... args)
|
template <class... Args> BOOST_FORCEINLINE bool emplace(Args&&... args)
|
||||||
|
@ -478,7 +478,7 @@ namespace boost {
|
|||||||
size_type insert_or_visit(std::initializer_list<value_type> ilist, F f)
|
size_type insert_or_visit(std::initializer_list<value_type> ilist, F f)
|
||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
||||||
return this->insert_or_visit(ilist.begin(), ilist.end(), f);
|
return this->insert_or_visit(ilist.begin(), ilist.end(), std::ref(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F>
|
template <class F>
|
||||||
@ -520,7 +520,7 @@ namespace boost {
|
|||||||
size_type insert_or_cvisit(std::initializer_list<value_type> ilist, F f)
|
size_type insert_or_cvisit(std::initializer_list<value_type> ilist, F f)
|
||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
||||||
return this->insert_or_cvisit(ilist.begin(), ilist.end(), f);
|
return this->insert_or_cvisit(ilist.begin(), ilist.end(), std::ref(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F1, class F2>
|
template <class F1, class F2>
|
||||||
@ -569,7 +569,8 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F1)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F1)
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
||||||
return this->insert_and_visit(ilist.begin(), ilist.end(), f1, f2);
|
return this->insert_and_visit(
|
||||||
|
ilist.begin(), ilist.end(), std::ref(f1), std::ref(f2));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F1, class F2>
|
template <class F1, class F2>
|
||||||
@ -619,7 +620,8 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F1)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F1)
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
||||||
return this->insert_and_cvisit(ilist.begin(), ilist.end(), f1, f2);
|
return this->insert_and_cvisit(
|
||||||
|
ilist.begin(), ilist.end(), std::ref(f1), std::ref(f2));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class... Args> BOOST_FORCEINLINE bool emplace(Args&&... args)
|
template <class... Args> BOOST_FORCEINLINE bool emplace(Args&&... args)
|
||||||
|
@ -513,7 +513,7 @@ namespace boost {
|
|||||||
size_type insert_or_visit(std::initializer_list<value_type> ilist, F f)
|
size_type insert_or_visit(std::initializer_list<value_type> ilist, F f)
|
||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F)
|
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F)
|
||||||
return this->insert_or_visit(ilist.begin(), ilist.end(), f);
|
return this->insert_or_visit(ilist.begin(), ilist.end(), std::ref(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F>
|
template <class F>
|
||||||
@ -567,7 +567,7 @@ namespace boost {
|
|||||||
size_type insert_or_cvisit(std::initializer_list<value_type> ilist, F f)
|
size_type insert_or_cvisit(std::initializer_list<value_type> ilist, F f)
|
||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
||||||
return this->insert_or_cvisit(ilist.begin(), ilist.end(), f);
|
return this->insert_or_cvisit(ilist.begin(), ilist.end(), std::ref(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F>
|
template <class F>
|
||||||
@ -627,7 +627,8 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F1)
|
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F1)
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F2)
|
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F2)
|
||||||
return this->insert_and_visit(ilist.begin(), ilist.end(), f1, f2);
|
return this->insert_and_visit(
|
||||||
|
ilist.begin(), ilist.end(), std::ref(f1), std::ref(f2));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F1, class F2>
|
template <class F1, class F2>
|
||||||
@ -688,7 +689,8 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F1)
|
BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F1)
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
||||||
return this->insert_and_cvisit(ilist.begin(), ilist.end(), f1, f2);
|
return this->insert_and_cvisit(
|
||||||
|
ilist.begin(), ilist.end(), std::ref(f1), std::ref(f2));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F1, class F2>
|
template <class F1, class F2>
|
||||||
|
@ -504,7 +504,7 @@ namespace boost {
|
|||||||
size_type insert_or_visit(std::initializer_list<value_type> ilist, F f)
|
size_type insert_or_visit(std::initializer_list<value_type> ilist, F f)
|
||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
||||||
return this->insert_or_visit(ilist.begin(), ilist.end(), f);
|
return this->insert_or_visit(ilist.begin(), ilist.end(), std::ref(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F>
|
template <class F>
|
||||||
@ -567,7 +567,7 @@ namespace boost {
|
|||||||
size_type insert_or_cvisit(std::initializer_list<value_type> ilist, F f)
|
size_type insert_or_cvisit(std::initializer_list<value_type> ilist, F f)
|
||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F)
|
||||||
return this->insert_or_cvisit(ilist.begin(), ilist.end(), f);
|
return this->insert_or_cvisit(ilist.begin(), ilist.end(), std::ref(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F>
|
template <class F>
|
||||||
@ -638,7 +638,8 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F1)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F1)
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
||||||
return this->insert_and_visit(ilist.begin(), ilist.end(), f1, f2);
|
return this->insert_and_visit(
|
||||||
|
ilist.begin(), ilist.end(), std::ref(f1), std::ref(f2));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F1, class F2>
|
template <class F1, class F2>
|
||||||
@ -710,7 +711,8 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F1)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F1)
|
||||||
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F2)
|
||||||
return this->insert_and_cvisit(ilist.begin(), ilist.end(), f1, f2);
|
return this->insert_and_cvisit(
|
||||||
|
ilist.begin(), ilist.end(), std::ref(f1), std::ref(f2));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F1, class F2>
|
template <class F1, class F2>
|
||||||
|
@ -13,10 +13,7 @@
|
|||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/mp11/algorithm.hpp>
|
#include <boost/mp11/algorithm.hpp>
|
||||||
#include <boost/mp11/list.hpp>
|
#include <boost/mp11/list.hpp>
|
||||||
|
#include <boost/unordered/detail/type_traits.hpp>
|
||||||
#include <functional>
|
|
||||||
#include <iterator>
|
|
||||||
#include <type_traits>
|
|
||||||
|
|
||||||
#define BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F) \
|
#define BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE(F) \
|
||||||
static_assert(boost::unordered::detail::is_invocable<F, value_type&>::value, \
|
static_assert(boost::unordered::detail::is_invocable<F, value_type&>::value, \
|
||||||
@ -79,13 +76,20 @@
|
|||||||
namespace boost {
|
namespace boost {
|
||||||
namespace unordered {
|
namespace unordered {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template <class F, class... Args>
|
template <class...> struct is_invocable_helper : std::false_type
|
||||||
struct is_invocable
|
|
||||||
: std::is_constructible<std::function<void(Args...)>,
|
|
||||||
std::reference_wrapper<typename std::remove_reference<F>::type> >
|
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class F, class... Args>
|
||||||
|
struct is_invocable_helper<
|
||||||
|
void_t<decltype(std::declval<F>()(std::declval<Args>()...))>, F,
|
||||||
|
Args...> : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class F, class... Args>
|
||||||
|
using is_invocable = is_invocable_helper<void, F, Args...>;
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
} // namespace unordered
|
} // namespace unordered
|
||||||
|
@ -947,6 +947,14 @@ namespace {
|
|||||||
}
|
}
|
||||||
} iterator_range_insert_and_visit;
|
} iterator_range_insert_and_visit;
|
||||||
|
|
||||||
|
struct non_copyable_function
|
||||||
|
{
|
||||||
|
non_copyable_function() = default;
|
||||||
|
non_copyable_function(const non_copyable_function&) = delete;
|
||||||
|
non_copyable_function(non_copyable_function&&) = default;
|
||||||
|
template <class... Args> void operator()(Args&&...) const {}
|
||||||
|
};
|
||||||
|
|
||||||
template <class X, class GF, class F>
|
template <class X, class GF, class F>
|
||||||
void insert(X*, GF gen_factory, F inserter, test::random_generator rg)
|
void insert(X*, GF gen_factory, F inserter, test::random_generator rg)
|
||||||
{
|
{
|
||||||
@ -1047,6 +1055,9 @@ namespace {
|
|||||||
++num_invokes;
|
++num_invokes;
|
||||||
}),
|
}),
|
||||||
init_list.size());
|
init_list.size());
|
||||||
|
|
||||||
|
x.insert_or_visit(init_list, non_copyable_function{});
|
||||||
|
x.insert_or_cvisit(init_list, non_copyable_function{});
|
||||||
});
|
});
|
||||||
|
|
||||||
BOOST_TEST_EQ(num_invokes, (init_list.size() - x.size()) +
|
BOOST_TEST_EQ(num_invokes, (init_list.size() - x.size()) +
|
||||||
@ -1105,6 +1116,11 @@ namespace {
|
|||||||
++num_invokes;
|
++num_invokes;
|
||||||
}),
|
}),
|
||||||
init_list.size());
|
init_list.size());
|
||||||
|
|
||||||
|
x.insert_and_visit(
|
||||||
|
init_list, non_copyable_function{}, non_copyable_function{});
|
||||||
|
x.insert_and_cvisit(
|
||||||
|
init_list, non_copyable_function{}, non_copyable_function{});
|
||||||
});
|
});
|
||||||
|
|
||||||
BOOST_TEST_EQ(num_inserts, x.size());
|
BOOST_TEST_EQ(num_inserts, x.size());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user