7#include <unordered_map>
8#include <unordered_set>
12#include <userver/dump/meta.hpp>
14USERVER_NAMESPACE_BEGIN
20template <
typename T,
typename Alloc>
21void Insert(std::vector<T, Alloc>& cont, T&& elem) {
22 cont.push_back(std::forward<T>(elem));
25template <
typename K,
typename V,
typename Comp,
typename Alloc>
26void Insert(std::map<K, V, Comp, Alloc>& cont, std::pair<
const K, V>&& elem) {
27 cont.insert(std::move(elem));
30template <
typename K,
typename V,
typename Hash,
typename Eq,
typename Alloc>
31void Insert(std::unordered_map<K, V, Hash, Eq, Alloc>& cont, std::pair<
const K, V>&& elem) {
32 cont.insert(std::move(elem));
35template <
typename T,
typename Comp,
typename Alloc>
36void Insert(std::set<T, Comp, Alloc>& cont, T&& elem) {
37 cont.insert(std::forward<T>(elem));
40template <
typename T,
typename Hash,
typename Eq,
typename Alloc>
41void Insert(std::unordered_set<T, Hash, Eq, Alloc>& cont, T&& elem) {
42 cont.insert(std::forward<T>(elem));
49using InsertResult =
decltype(dump::Insert(std::declval<T&>(), std::declval<meta::RangeValueType<T>&&>()));