Commit 1402f40c authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

core: add two usefull identifier functions

parent fd5aa4a3
......@@ -165,6 +165,28 @@ undefined() noexcept
return static_cast<Identifier>(0);
}
template<typename Identifier>
constexpr bool
is_undefined(Identifier id) noexcept
{
static_assert(
std::is_enum<Identifier>::value,
"Identifier must be a enumeration: enum class id : unsigned {};");
return id == undefined<Identifier>();
}
template<typename Identifier>
constexpr bool
is_defined(Identifier id) noexcept
{
static_assert(
std::is_enum<Identifier>::value,
"Identifier must be a enumeration: enum class id : unsigned {};");
return id != undefined<Identifier>();
}
/*****************************************************************************
*
* Return status of many function
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment