#pragma once namespace glbinding { template GLBINDING_CONSTEXPR SharedBitfieldBase::SharedBitfieldBase(T value) : m_value{value} { } template GLBINDING_CONSTEXPR SharedBitfieldBase::operator T() const { return m_value; } template template GLBINDING_CONSTEXPR SharedBitfield::SharedBitfield(ConstructionType value) : SharedBitfieldBase::type>(static_cast::type>(value)) { static_assert(is_member_of_SharedBitfield::value, "Not a member of SharedBitfield"); } template GLBINDING_CONSTEXPR SharedBitfield::SharedBitfield(typename std::underlying_type::type value) : SharedBitfieldBase::type>(value) { } template GLBINDING_CONSTEXPR SharedBitfield::operator Type() const { return static_cast(this->m_value); } template template GLBINDING_CONSTEXPR auto SharedBitfield::operator|(SharedBitfield other) const -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, typename intersect_SharedBitfield, SharedBitfield>::type>::type { return typename intersect_SharedBitfield, SharedBitfield>::type(this->m_value | static_castm_value)>(other)); } template template auto SharedBitfield::operator|=(SharedBitfield other) -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, SharedBitfield &>::type { this->m_value |= static_castm_value)>(other); return *this; } template template GLBINDING_CONSTEXPR auto SharedBitfield::operator&(SharedBitfield other) const -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, typename intersect_SharedBitfield, SharedBitfield>::type>::type { return typename intersect_SharedBitfield, SharedBitfield>::type(this->m_value & static_castm_value)>(other)); } template template auto SharedBitfield::operator&=(SharedBitfield other) -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, SharedBitfield &>::type { this->m_value &= static_castm_value)>(other); return *this; } template template GLBINDING_CONSTEXPR auto SharedBitfield::operator^(SharedBitfield other) const -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, typename intersect_SharedBitfield, SharedBitfield>::type>::type { return typename intersect_SharedBitfield, SharedBitfield>::type(this->m_value ^static_castm_value)>(other)); } template template auto SharedBitfield::operator^=(SharedBitfield other) -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, SharedBitfield &>::type { this->m_value ^= static_castm_value)>(other); return *this; } template template GLBINDING_CONSTEXPR auto SharedBitfield::operator==(SharedBitfield other) const -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, bool>::type { return static_cast(*this) == static_cast(other); } template template GLBINDING_CONSTEXPR auto SharedBitfield::operator==(T other) const -> typename std::enable_if::value, bool>::type { return static_cast(*this) == static_cast(other); } template template GLBINDING_CONSTEXPR SharedBitfield::SharedBitfield(ConstructionType value) : SharedBitfield(static_cast::type>(value)) { static_assert(is_member_of_SharedBitfield::value, "Not a member of SharedBitfield"); } template GLBINDING_CONSTEXPR SharedBitfield::SharedBitfield(typename std::underlying_type::type value) : SharedBitfield(value) { } template GLBINDING_CONSTEXPR SharedBitfield::operator Type() const { return static_cast(this->m_value); } template template GLBINDING_CONSTEXPR auto SharedBitfield::operator|(SharedBitfield other) const -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, typename intersect_SharedBitfield, SharedBitfield>::type>::type { return typename intersect_SharedBitfield, SharedBitfield>::type(this->m_value | static_castm_value)>(other)); } template template auto SharedBitfield::operator|=(SharedBitfield other) -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, SharedBitfield &>::type { this->m_value |= static_castm_value)>(other); return *this; } template template GLBINDING_CONSTEXPR auto SharedBitfield::operator&(SharedBitfield other) const -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, typename intersect_SharedBitfield, SharedBitfield>::type>::type { return typename intersect_SharedBitfield, SharedBitfield>::type(this->m_value & static_castm_value)>(other)); } template template auto SharedBitfield::operator&=(SharedBitfield other) -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, SharedBitfield &>::type { this->m_value &= static_castm_value)>(other); return *this; } template template GLBINDING_CONSTEXPR auto SharedBitfield::operator^(SharedBitfield other) const -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, typename intersect_SharedBitfield, SharedBitfield>::type>::type { return typename intersect_SharedBitfield, SharedBitfield>::type(this->m_value ^static_castm_value)>(other)); } template template auto SharedBitfield::operator^=(SharedBitfield other) -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, SharedBitfield &>::type { this->m_value ^= static_castm_value)>(other); return *this; } template template GLBINDING_CONSTEXPR auto SharedBitfield::operator==(SharedBitfield other) const -> typename std::enable_if, SharedBitfield>::type, SharedBitfield<>>::value, bool>::type { return static_cast(*this) == static_cast(other); } template template GLBINDING_CONSTEXPR auto SharedBitfield::operator==(T other) const -> typename std::enable_if::value, bool>::type { return static_cast(*this) == static_cast(other); } template GLBINDING_CONSTEXPR typename std::enable_if::value, Enum>::type>::type>, ConvertibleEnum>::value, Enum>::type operator|(Enum a, ConvertibleEnum b) { return a | static_cast(b); } template GLBINDING_CONSTEXPR typename std::enable_if::value, Enum>::type>::type>, ConvertibleEnum>::value, Enum>::type operator|(ConvertibleEnum a, Enum b) { return static_cast(a) | b; } template typename std::enable_if::value, Enum>::type>::type>, ConvertibleEnum>::value, Enum>::type operator|=(Enum & a, ConvertibleEnum b) { return a |= static_cast(b); } template GLBINDING_CONSTEXPR typename std::enable_if::value, Enum>::type>::type>, ConvertibleEnum>::value, Enum>::type operator&(Enum a, ConvertibleEnum b) { return a & static_cast(b); } template GLBINDING_CONSTEXPR typename std::enable_if::value, Enum>::type>::type>, ConvertibleEnum>::value, Enum>::type operator&(ConvertibleEnum a, Enum b) { return static_cast(a) & b; } template typename std::enable_if::value, Enum>::type>::type>, ConvertibleEnum>::value, Enum>::type operator&=(Enum & a, ConvertibleEnum b) { return a &= static_cast(b); } template GLBINDING_CONSTEXPR typename std::enable_if::value, Enum>::type>::type>, ConvertibleEnum>::value, Enum>::type operator^(Enum a, ConvertibleEnum b) { return a ^ static_cast(b); } template GLBINDING_CONSTEXPR typename std::enable_if::value, Enum>::type>::type>, ConvertibleEnum>::value, Enum>::type operator^(ConvertibleEnum a, Enum b) { return static_cast(a) ^ b; } template typename std::enable_if::value, Enum>::type>::type>, ConvertibleEnum>::value, Enum>::type operator^=(Enum & a, ConvertibleEnum b) { return a ^= static_cast(b); } } // namespace glbinding