#include <userver/utils/trivial_map.hpp>
Unordered set for trivial types, including string literals.
For a two-value Case statements or efficiency notes see utils::TrivialBiMap.
Definition at line 897 of file trivial_map.hpp.
Public Types | |
| using | First = typename TypesPair::first_type |
| using | Second = typename TypesPair::second_type |
Public Member Functions | |
| constexpr | TrivialSet (BuilderFunc &&func) noexcept |
| constexpr bool | Contains (DecayToStringView< First > value) const noexcept |
| constexpr bool | ContainsICase (std::string_view value) const noexcept |
| constexpr std::size_t | size () const noexcept |
| Returns count of Case's in mapping. | |
| std::string | Describe () const |
| constexpr std::optional< std::size_t > | GetIndex (DecayToStringView< First > value) const |
| Returns index of the value in Case parameters or std::nullopt if no such value. | |
| constexpr std::optional< std::size_t > | GetIndexICase (std::string_view value) const |
| constexpr First | GetKeyByIndex (std::size_t index) const |
| Returns the parameter of a Case with index index. | |
| using utils::TrivialSet< BuilderFunc >::First = typename TypesPair::first_type |
Definition at line 901 of file trivial_map.hpp.
| using utils::TrivialSet< BuilderFunc >::Second = typename TypesPair::second_type |
Definition at line 902 of file trivial_map.hpp.
|
inlineconstexprnoexcept |
Definition at line 904 of file trivial_map.hpp.
|
inlineconstexprnoexcept |
Definition at line 910 of file trivial_map.hpp.
|
inlineconstexprnoexcept |
Definition at line 914 of file trivial_map.hpp.
|
inline |
Returns a string of comma separated quoted values of Case parameters.
Example: "'a', 'b', 'c'"
Parameters of Case should be formattable.
Definition at line 933 of file trivial_map.hpp.
|
inlineconstexpr |
Returns index of the value in Case parameters or std::nullopt if no such value.
Definition at line 938 of file trivial_map.hpp.
|
inlineconstexpr |
Returns index of the case insensitive value in Case parameters or std::nullopt if no such value.
Definition at line 944 of file trivial_map.hpp.
|
inlineconstexpr |
Returns the parameter of a Case with index index.
Definition at line 949 of file trivial_map.hpp.
|
inlineconstexprnoexcept |
Returns count of Case's in mapping.
Definition at line 924 of file trivial_map.hpp.