Правка регистра

This commit is contained in:
2020-04-21 10:59:42 +03:00
parent 95a197a873
commit ab740f7795
6 changed files with 23 additions and 24 deletions

View File

@ -13,17 +13,17 @@ namespace base {
template< typename Enum >
struct EnableBitMaskOperators
{
static const bool enable = false;
static const bool k_Enable = false;
};
template< typename Enum >
typename std::enable_if< EnableBitMaskOperators< Enum >::enable, Enum >::type
typename std::enable_if< EnableBitMaskOperators< Enum >::k_Enable, Enum >::type
operator |( Enum lhs, Enum rhs )
{
using underlying = typename std::underlying_type< Enum >::type;
using Underlying = typename std::underlying_type< Enum >::type;
return( static_cast< Enum >(
static_cast< underlying >( lhs ) |
static_cast< underlying >( rhs )
static_cast< Underlying >( lhs ) |
static_cast< Underlying >( rhs )
) );
}
@ -52,7 +52,7 @@ operator |( Enum lhs, Enum rhs )
template<> \
struct myx::base::EnableBitMaskOperators< x > \
{ \
static const bool enable = true; \
static const bool k_Enable = true; \
};
#endif // ifndef MYX_BASE_ENUM_BITWISE_OPERATIONS_HPP_