#include <userver/utils/strong_typedef.hpp>
Strong typedef for a type T.
Typical usage:
Or:
Has all the:
If used with container-like type also has common STL functions:
Operators: You can customize the operators that are available by passing the third argument of type StrongTypedefOps. See its docs for more info.
Definition at line 163 of file strong_typedef.hpp.
Inheritance diagram for utils::StrongTypedef< Tag, T, Ops >:Public Types | |
| using | UnderlyingType = T |
| using | TagType = Tag |
Public Member Functions | |
| StrongTypedef (const StrongTypedef &)=default | |
| StrongTypedef (StrongTypedef &&) noexcept=default | |
| StrongTypedef & | operator= (const StrongTypedef &)=default |
| StrongTypedef & | operator= (StrongTypedef &&) noexcept=default |
| constexpr | StrongTypedef (impl::strong_typedef::InitializerList< T > lst) |
| template<typename... Args> requires std::is_constructible_v<T, Args...> | |
| constexpr | StrongTypedef (Args &&... args) noexcept(noexcept(T(std::forward< Args >(args)...))) |
| constexpr | operator const T & () const &noexcept USERVER_IMPL_LIFETIME_BOUND |
| constexpr | operator T () &&noexcept |
| constexpr | operator T& () &noexcept USERVER_IMPL_LIFETIME_BOUND |
| constexpr const T & | GetUnderlying () const &noexcept USERVER_IMPL_LIFETIME_BOUND |
| constexpr T | GetUnderlying () &&noexcept |
| constexpr T & | GetUnderlying () &noexcept USERVER_IMPL_LIFETIME_BOUND |
| auto | begin () |
| auto | end () |
| auto | begin () const |
| auto | end () const |
| auto | cbegin () const |
| auto | cend () const |
| auto | size () const |
| auto | empty () const |
| auto | clear () |
| template<class Arg> | |
| decltype(auto) | operator[] (Arg &&i) |
| template<class Arg> | |
| decltype(auto) | operator[] (Arg &&i) const |
Static Public Attributes | |
| static constexpr StrongTypedefOps | kOps = Ops |
| using utils::StrongTypedef< Tag, T, Ops >::TagType = Tag |
Definition at line 172 of file strong_typedef.hpp.
| using utils::StrongTypedef< Tag, T, Ops >::UnderlyingType = T |
Definition at line 171 of file strong_typedef.hpp.
|
inlineconstexpr |
Definition at line 181 of file strong_typedef.hpp.
|
inlineexplicitconstexprnoexcept |
Definition at line 187 of file strong_typedef.hpp.
|
inline |
Definition at line 206 of file strong_typedef.hpp.
|
inline |
Definition at line 218 of file strong_typedef.hpp.
|
inline |
Definition at line 230 of file strong_typedef.hpp.
|
inline |
Definition at line 236 of file strong_typedef.hpp.
|
inline |
Definition at line 250 of file strong_typedef.hpp.
|
inline |
Definition at line 248 of file strong_typedef.hpp.
|
inline |
Definition at line 212 of file strong_typedef.hpp.
|
inline |
Definition at line 224 of file strong_typedef.hpp.
|
inlineconstexprnoexcept |
Definition at line 203 of file strong_typedef.hpp.
|
inlineconstexprnoexcept |
Definition at line 204 of file strong_typedef.hpp.
|
inlineconstexprnoexcept |
Definition at line 202 of file strong_typedef.hpp.
|
inlineexplicitconstexprnoexcept |
Definition at line 198 of file strong_typedef.hpp.
|
inlineexplicitconstexprnoexcept |
Definition at line 199 of file strong_typedef.hpp.
|
inlineexplicitconstexprnoexcept |
Definition at line 200 of file strong_typedef.hpp.
|
inline |
Definition at line 253 of file strong_typedef.hpp.
|
inline |
Definition at line 257 of file strong_typedef.hpp.
|
inline |
Definition at line 242 of file strong_typedef.hpp.
|
staticconstexpr |
Definition at line 173 of file strong_typedef.hpp.