22#include <userver/utils/constexpr_indices.hpp>
23#include <userver/utils/lazy_prvalue.hpp>
24#include <userver/utils/meta.hpp>
25#include <userver/utils/strong_typedef.hpp>
27#include <userver/dump/common.hpp>
28#include <userver/dump/meta.hpp>
29#include <userver/dump/meta_containers.hpp>
30#include <userver/dump/operations.hpp>
37template <
typename L,
typename R,
typename AP1,
typename AP2,
typename AP3>
42namespace multi_index {
44template <
typename Value,
typename IndexSpecifierList,
typename Allocator>
45class multi_index_container;
50using multi_index::multi_index_container;
55USERVER_NAMESPACE_BEGIN
61template <
typename L,
typename R,
typename... Args>
62using BoostBimap = boost::bimap<L, R, Args...>;
64template <
typename L,
typename R,
typename... Args>
65using BoostBimapLeftKey =
typename BoostBimap<L, R, Args...>::left_key_type;
67template <
typename L,
typename R,
typename... Args>
68using BoostBimapRightKey =
typename BoostBimap<L, R, Args...>::right_key_type;
71auto ReadLazyPrvalue(
Reader& reader) {
72 return utils::LazyPrvalue([&reader] {
return reader.Read<T>(); });
75[[noreturn]]
void ThrowInvalidVariantIndex(
const std::type_info& type, std::size_t index);
77template <
typename VariantType>
78VariantType ReadVariant(
Reader& reader, std::size_t index) {
79 static constexpr auto VariantSize = std::variant_size_v<VariantType>;
80 std::optional<VariantType> result;
82 utils::WithConstexprIndex<VariantSize>(index, [&](
auto index_constant) {
83 static constexpr auto kIndex =
decltype(index_constant)::value;
84 using Alternative = std::variant_alternative_t<kIndex, VariantType>;
86 result.emplace(std::in_place_index<kIndex>, reader.Read<Alternative>());
89 return std::move(*result);
119template <
typename T,
typename U>
126template <
typename T,
typename U>
146template <
typename...
Args>
153template <
typename...
Args>
216template <
typename L,
typename R,
typename...
Args>
229template <
typename L,
typename R,
typename...
Args>
257template <
typename T,
typename Index,
typename Alloc>
266template <
typename T,
typename Index,
typename Alloc>