Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Pour information : coupure de la forge ce matin entre 6h45 et 7h05 pour une mise à jour de sécurité
Open sidebar
Gauthier Quesnel
irritator
Commits
1402f40c
Commit
1402f40c
authored
May 21, 2021
by
Gauthier Quesnel
Browse files
core: add two usefull identifier functions
parent
fd5aa4a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/include/irritator/core.hpp
View file @
1402f40c
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment