types/tagged: add type query
This commit is contained in:
parent
757253ee4e
commit
c9b5605213
@ -82,6 +82,15 @@ namespace cruft {
|
||||
auto tag (void) { return m_tag; }
|
||||
|
||||
|
||||
/// Returns true if the contained type is the same as the type
|
||||
/// specified in the template parameter.
|
||||
template <typename QueryT>
|
||||
bool is (void) const noexcept
|
||||
{
|
||||
return QueryT::tag == m_tag;
|
||||
}
|
||||
|
||||
|
||||
///--------------------------------------------------------------------
|
||||
/// Return a reference to a stored value of known type.
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user