userver
C++ Async Framework
Loading...
Searching...
No Matches
hash_map.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file
4
/// @brief @copybrief proto_structs::HashMap
5
6
#
include
<
type_traits
>
7
#
include
<
unordered_map
>
8
9
#
include
<
userver
/
utils
/
str_icase
.
hpp
>
10
11
USERVER_NAMESPACE_BEGIN
12
13
namespace
proto_structs {
14
15
/// @brief The hash map container used in userver proto structs by default.
16
///
17
/// Currently implemented as just `std::unordered_map`. Please don't assume it! For example:
18
///
19
/// * Don't pass the field to functions as `std::unordered_map`, use `proto_structs::HashMap` instead;
20
/// * Don't use node and bucket APIs of `std::unordered_map` with these fields.
21
template
<
typename
Key,
typename
Value>
22
using
HashMap = std::unordered_map<
23
Key,
24
Value,
25
std::conditional_t<std::is_convertible_v<Key, std::string_view>,
utils
::
StrCaseHash
, std::hash<Key>>>;
26
27
}
// namespace proto_structs
28
29
USERVER_NAMESPACE_END
proto-structs
include
userver
proto-structs
hash_map.hpp
Generated on Tue Sep 2 2025 12:38:22 for userver by
Doxygen
1.13.2