|
commons 0.1.5
Header-only C++23 library of common/shared types for the C++ libraries
|
CRTP base wiring kind(), clone(), and info() from a compile-time kind string and the concrete Derived type.
More...
#include <origin.hpp>


Public Member Functions | |
| std::string_view | kind () const noexcept override |
The stable discriminator for this origin (e.g. "core"). | |
| std::unique_ptr< IOrigin > | clone () const override |
| A deep, independent copy. | |
| const DisplayInfo & | info () const override |
Presentation metadata for this origin's kind (the description), sourced from the concrete type's static display_info(). | |
Static Public Attributes | |
| static constexpr std::string_view | KIND = Kind.view() |
| Compile-time discriminator. | |
CRTP base wiring kind(), clone(), and info() from a compile-time kind string and the concrete Derived type.
Use it as class CoreOrigin final : public OriginKind<"core", CoreOrigin> { ... };. Derived must be copy-constructible (for clone()) and expose a static const DisplayInfo& display_info() (for info()).