userver: utils::TrivialSet< BuilderFunc > Class Template Reference
Loading...
Searching...
No Matches
utils::TrivialSet< BuilderFunc > Class Template Referencefinal

#include <userver/utils/trivial_map.hpp>

Detailed Description

template<typename BuilderFunc>
class utils::TrivialSet< BuilderFunc >

Unordered set for trivial types, including string literals.

For a two-value Case statements or efficiency notes see utils::TrivialBimap.

Definition at line 778 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 (First value) const noexcept
 
constexpr bool ContainsICase (std::string_view value) const noexcept
 
constexpr std::size_t size () const noexcept
 
std::string Describe () const
 
constexpr std::optional< std::size_t > GetIndex (First value) const
 
constexpr std::optional< std::size_t > GetIndexICase (First value) const
 

Member Typedef Documentation

◆ First

template<typename BuilderFunc >
using utils::TrivialSet< BuilderFunc >::First = typename TypesPair::first_type

Definition at line 782 of file trivial_map.hpp.

◆ Second

template<typename BuilderFunc >
using utils::TrivialSet< BuilderFunc >::Second = typename TypesPair::second_type

Definition at line 783 of file trivial_map.hpp.

Constructor & Destructor Documentation

◆ TrivialSet()

template<typename BuilderFunc >
constexpr utils::TrivialSet< BuilderFunc >::TrivialSet ( BuilderFunc && func)
inlineconstexprnoexcept

Definition at line 785 of file trivial_map.hpp.

Member Function Documentation

◆ Contains()

template<typename BuilderFunc >
constexpr bool utils::TrivialSet< BuilderFunc >::Contains ( First value) const
inlineconstexprnoexcept

Definition at line 791 of file trivial_map.hpp.

◆ ContainsICase()

template<typename BuilderFunc >
constexpr bool utils::TrivialSet< BuilderFunc >::ContainsICase ( std::string_view value) const
inlineconstexprnoexcept

Definition at line 795 of file trivial_map.hpp.

◆ Describe()

template<typename BuilderFunc >
std::string utils::TrivialSet< BuilderFunc >::Describe ( ) const
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 810 of file trivial_map.hpp.

◆ GetIndex()

template<typename BuilderFunc >
constexpr std::optional< std::size_t > utils::TrivialSet< BuilderFunc >::GetIndex ( First value) const
inlineconstexpr

Returns index of the value in Case parameters or std::nullopt if no such value.

Definition at line 816 of file trivial_map.hpp.

◆ GetIndexICase()

template<typename BuilderFunc >
constexpr std::optional< std::size_t > utils::TrivialSet< BuilderFunc >::GetIndexICase ( First value) const
inlineconstexpr

Returns index of the case insensitive value in Case parameters or std::nullopt if no such value.

Definition at line 822 of file trivial_map.hpp.

◆ size()

template<typename BuilderFunc >
constexpr std::size_t utils::TrivialSet< BuilderFunc >::size ( ) const
inlineconstexprnoexcept

Definition at line 801 of file trivial_map.hpp.


The documentation for this class was generated from the following file: