diff options
Diffstat (limited to 'bitfield.h')
-rw-r--r-- | bitfield.h | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -10,7 +10,7 @@ namespace impl { * Constant check for supported underlying BITFILED types. */ template <typename ValueType> -static constexpr bool is_bitfield_type = +static constexpr bool is_bitfield_type_v = std::is_integral<ValueType>::value && std::is_unsigned<ValueType>::value && !std::is_same<ValueType, bool>::value; @@ -107,7 +107,7 @@ struct const_field_ref { */ template <typename ValueType = std::uint32_t> struct bitfield { - static_assert(impl::is_bitfield_type<ValueType>, + static_assert(impl::is_bitfield_type_v<ValueType>, "bitfield instantiated with incorrect type"); constexpr explicit bitfield(ValueType val) : m_val{val} {} @@ -177,11 +177,11 @@ struct bitfield { // -- TESTS -------------------------------------------------------------------- -static_assert(impl::is_bitfield_type<std::uint32_t>, ""); -static_assert(!impl::is_bitfield_type<bool>, ""); -static_assert(!impl::is_bitfield_type<std::int32_t>, ""); -static_assert(!impl::is_bitfield_type<std::uint32_t*>, ""); -static_assert(!impl::is_bitfield_type<float>, ""); +static_assert(impl::is_bitfield_type_v<std::uint32_t>, ""); +static_assert(!impl::is_bitfield_type_v<bool>, ""); +static_assert(!impl::is_bitfield_type_v<std::int32_t>, ""); +static_assert(!impl::is_bitfield_type_v<std::uint32_t*>, ""); +static_assert(!impl::is_bitfield_type_v<float>, ""); static_assert(impl::compute_mask<0, 0, std::uint32_t>() == 0x1, ""); static_assert(impl::compute_mask<4, 7, std::uint32_t>() == 0xf0, ""); |