mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Misc: Fixed engrish in static_assert for EnumFlag and restrict DEFINE_ENUM_FLAG to enums only (with std::is_enum)
This commit is contained in:
@@ -28,7 +28,7 @@ constexpr bool IsEnumFlag(T) { return false; }
|
||||
namespace EnumTraits
|
||||
{
|
||||
template<typename T>
|
||||
using IsFlag = std::integral_constant<bool, IsEnumFlag(T{})>;
|
||||
using IsFlag = std::conjunction<std::is_enum<T>, std::integral_constant<bool, IsEnumFlag(T{})>>;
|
||||
}
|
||||
|
||||
template<typename T, std::enable_if_t<EnumTraits::IsFlag<T>::value, std::nullptr_t> = nullptr>
|
||||
@@ -64,7 +64,7 @@ inline constexpr T operator~(T value)
|
||||
template<typename T>
|
||||
class EnumFlag
|
||||
{
|
||||
static_assert(EnumTraits::IsFlag<T>::value, "EnumFlag must be used only with enums that are specify EnumFlag::IsFlag");
|
||||
static_assert(EnumTraits::IsFlag<T>::value, "EnumFlag must be used only with enums that are marked as flags by DEFINE_ENUM_FLAG macro");
|
||||
|
||||
public:
|
||||
/*implicit*/ constexpr EnumFlag(T value) : _value(value)
|
||||
|
||||
Reference in New Issue
Block a user