Class Taggable¶
Defined in File tag.hpp
Inheritance Relationships¶
Derived Type¶
public sequant::Index
(Class Index)
Class Documentation¶
-
class Taggable¶
type-erasing holder for Comparable objects
Note
tag is not part of the state (since tag are temporary and do not affect objects identity except for temporarily labeling them), hence all methods are const
Subclassed by sequant::Index
Public Types
-
using any_comparable = ::sequant::detail::any_comparable¶
Public Functions
-
inline Taggable() noexcept¶
-
template<typename T>
inline const Taggable &assign(const T &t) const¶ tags this object with tag
t
- Parameters:
t – tag to assign
- Returns:
reference to this (for chaining)
- Pre:
!this->has_value()
- Post:
this->value() == t
-
template<typename T>
inline const T &value() const¶ - Throws:
bad_any_comparable_cast – if the contained value is not convertible to T
- Returns:
this tag’s value
-
inline bool has_value() const¶
- Returns:
true if tag has been assigned
-
using any_comparable = ::sequant::detail::any_comparable¶