BAN: Implement Variant::has_value() and Variant::operator bool()

This commit is contained in:
Bananymous 2024-07-12 20:37:56 +03:00
parent f120da3aca
commit 110a45bee6
1 changed files with 10 additions and 0 deletions

View File

@ -286,6 +286,16 @@ namespace BAN
return **reinterpret_cast<const remove_reference_t<T>**>(m_storage);
}
bool has_value() const
{
return m_index != invalid_index();
}
explicit operator bool() const
{
return has_value();
}
void clear()
{
if (m_index != invalid_index())