class constructor
Defined at line 2626 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
Extension API: support for lazy emplace.
Looks up key in the table. If found, returns the iterator to the element.
Otherwise calls `f` with one argument of type `raw_hash_set::constructor`,
and returns an iterator to the new element.
`f` must abide by several restrictions:
- it MUST call `raw_hash_set::constructor` with arguments as if a
`raw_hash_set::value_type` is constructed,
- it MUST NOT access the container before the call to
`raw_hash_set::constructor`, and
- it MUST NOT erase the lazily emplaced element.
Doing any of these is undefined behavior.
For example:
std::unordered_set
<ArenaString
> s;
// Makes ArenaStr even if "abc" is in the map.
s.insert(ArenaString(
&arena
, "abc"));
flat_hash_set
<ArenaStr
> s;
// Makes ArenaStr only if "abc" is not in the map.
s.lazy_emplace("abc", [
&
](const constructor
&
ctor) {
ctor(
&arena
, "abc");
});
WARNING: This API is currently experimental. If there is a way to implement
the same thing with the rest of the API, prefer that.
Public Methods
template <class... Args>
void operator() (Args &&... args)
Defined at line 2631 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
Friends
class raw_hash_set