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,
32 std::pair<
const K, V>&& elem) {
33 cont.insert(std::move(elem));
36template <
typename T,
typename Comp,
typename Alloc>
37void Insert(std::set<T, Comp, Alloc>& cont, T&& elem) {
38 cont.insert(std::forward<T>(elem));
41template <
typename T,
typename Hash,
typename Eq,
typename Alloc>
42void Insert(std::unordered_set<T, Hash, Eq, Alloc>& cont, T&& elem) {
43 cont.insert(std::forward<T>(elem));
50using InsertResult =
decltype(dump::Insert(
51 std::declval<T&>(), std::declval<meta::RangeValueType<T>&&>()));