MySQL 9.6.0
Source Code Documentation
mysql::containers Namespace Reference

Namespaces

namespace  buffers
 
namespace  throwing
 

Classes

class  Basic_container_wrapper
 CRTP base class (mixin) to define a wrapper around a container. More...
 

Functions

void node_handle_assign (auto &node_handle, auto &iterator) noexcept
 For a node_handle retrieved from the extract member of one of the std::[unordered_][multi]{set|map} containers, and an iterator over a container with the same value_type, copy the value pointed to by the iterator to the node_handle. More...
 
template<class Map_or_set_t >
auto make_empty_map_or_set_and_copy_metadata (const Map_or_set_t &map_or_set)
 Return a new object of the same type as the parameter, without any elements, with the same allocator, and if the object type has key comparison, the same comparison object. More...
 
template<class Source_iterator_t >
auto map_or_set_assign (auto &map_or_set, const Source_iterator_t &first, const std::sentinel_for< Source_iterator_t > auto &last) noexcept
 Replace the contents of container with that of the range given by the two iterators, minimizing memory allocations. More...
 

Function Documentation

◆ make_empty_map_or_set_and_copy_metadata()

template<class Map_or_set_t >
auto mysql::containers::make_empty_map_or_set_and_copy_metadata ( const Map_or_set_t &  map_or_set)

Return a new object of the same type as the parameter, without any elements, with the same allocator, and if the object type has key comparison, the same comparison object.

◆ map_or_set_assign()

template<class Source_iterator_t >
auto mysql::containers::map_or_set_assign ( auto &  map_or_set,
const Source_iterator_t &  first,
const std::sentinel_for< Source_iterator_t > auto &  last 
)
noexcept

Replace the contents of container with that of the range given by the two iterators, minimizing memory allocations.

This reuses existing nodes of the target container as far as possible, and allocates new ones only if the source has more nodes than the target container.

It does not copy the allocator.

Informally, this is to std::map what std::vector:assign is to std::vector.

Parameters
map_or_setContainer to overwrite.
firstIterator to first element of new contents.
lastIterator to last element of new contents.
Return values
Return_status::okSuccess
Return_status::errorOut of memory. This can only occur if the source range has more elements than the container.

◆ node_handle_assign()

void mysql::containers::node_handle_assign ( auto &  node_handle,
auto &  iterator 
)
noexcept

For a node_handle retrieved from the extract member of one of the std::[unordered_][multi]{set|map} containers, and an iterator over a container with the same value_type, copy the value pointed to by the iterator to the node_handle.

The purpose is to provide a uniform API, since node_handle objects of sets and maps are different.

Parameters
node_handleNode handle to copy to.
iteratorIterator to the value to copy from.