Core/Flags: Allow explicit operator conversion to any integer type of the same size (or greater size) than the internal size

This commit is contained in:
Jérôme Leclercq
2017-11-22 12:58:17 +01:00
parent 1b80ad5f02
commit 54faabcc33
3 changed files with 13 additions and 9 deletions

View File

@@ -52,13 +52,14 @@ namespace Nz
}
/*!
* \brief Converts to a bitfield
* \return Enabled flags as a bitfield.
* \brief Converts to an integer
* \return Enabled flags as a integer
*
* This will convert to a bitfield value.
* This will only works if the integer type is large enough to store all flags states
*/
template<typename E>
constexpr Flags<E>::operator BitField() const
template<typename T, typename>
constexpr Flags<E>::operator T() const
{
return m_value;
}