tagval 0.2.0
Modern C++23 header-only library of tagged values (open/closed enumerations with metadata)
Loading...
Searching...
No Matches
tagval::detail Namespace Reference

Classes

class  HandleBase
 CRTP handle. More...
 
class  KindViewFactory
 Builds a KindView for a single concrete kind type. More...
 
class  TagValBaseTag
 Empty marker base — used by std::hash / std::formatter / operator<< specializations to recognize all tagval value types. More...
 

Concepts

concept  HasMakeDescriptor
 
concept  TagValKind
 Concept: T is a tag-value kind (derives from ClosedEnded or OpenEnded).
 
concept  HasValuesT
 

Functions

template<comms::FixedString Id, typename Derived >
constexpr TagValDescriptor compute_descriptor () noexcept
 
std::size_t hash_combine (std::size_t seed, const std::size_t v) noexcept
 
template<comms::FixedString Id, typename T >
constexpr KindCategory probe_kind (ClosedEnded< Id, T > *) noexcept
 Overload set used to detect whether T is a tag-value kind and, if so, which CRTP base it derives from.
 
template<comms::FixedString Id, typename T >
constexpr KindCategory probe_kind (OpenEnded< Id, T > *) noexcept
 
constexpr std::monostate probe_kind (...) noexcept
 
template<typename T >
requires TagValKind<T>
constexpr KindCategory category_of () noexcept
 Category of a tag-value kind.
 
template<typename... Es>
consteval bool all_codes_unique () noexcept
 
template<typename... Es>
constexpr auto values_metadata_array_impl (std::tuple< Es... > *)
 
template<typename... Es>
constexpr auto values_metadata_pointers_impl (std::tuple< Es... > *)
 

Function Documentation

◆ compute_descriptor()

template<comms::FixedString Id, typename Derived >
constexpr TagValDescriptor tagval::detail::compute_descriptor ( )
constexprnoexcept

◆ hash_combine()

std::size_t tagval::detail::hash_combine ( std::size_t  seed,
const std::size_t  v 
)
inlinenoexcept

◆ probe_kind() [1/3]

template<comms::FixedString Id, typename T >
constexpr KindCategory tagval::detail::probe_kind ( ClosedEnded< Id, T > *  )
constexprnoexcept

Overload set used to detect whether T is a tag-value kind and, if so, which CRTP base it derives from.

Relies on the standard rule that template argument deduction from a derived class to a base-class pointer succeeds when the base is a class template specialization (see [temp.deduct.call]/4).

◆ probe_kind() [2/3]

template<comms::FixedString Id, typename T >
constexpr KindCategory tagval::detail::probe_kind ( OpenEnded< Id, T > *  )
constexprnoexcept

◆ probe_kind() [3/3]

constexpr std::monostate tagval::detail::probe_kind (   ...)
constexprnoexcept

◆ category_of()

template<typename T >
requires TagValKind<T>
constexpr KindCategory tagval::detail::category_of ( )
constexprnoexcept

Category of a tag-value kind.

Only callable for types that satisfy TagValKind.

◆ all_codes_unique()

template<typename... Es>
consteval bool tagval::detail::all_codes_unique ( )
noexcept

◆ values_metadata_array_impl()

template<typename... Es>
constexpr auto tagval::detail::values_metadata_array_impl ( std::tuple< Es... > *  )
constexpr

◆ values_metadata_pointers_impl()

template<typename... Es>
constexpr auto tagval::detail::values_metadata_pointers_impl ( std::tuple< Es... > *  )
constexpr