From 851d4fb9db087eeb183f1c1cb5d96829a32e690b Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Tue, 8 Aug 2023 22:18:28 +0200 Subject: add clang-tidy and fix lints --- bitfield.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'bitfield.h') diff --git a/bitfield.h b/bitfield.h index 833a722..9aafaf8 100644 --- a/bitfield.h +++ b/bitfield.h @@ -10,7 +10,7 @@ namespace impl { * Constant check for supported underlying BITFILED types. */ template -static constexpr bool is_bitfield_type = +static constexpr bool is_bitfield_type_v = std::is_integral::value && std::is_unsigned::value && !std::is_same::value; @@ -107,7 +107,7 @@ struct const_field_ref { */ template struct bitfield { - static_assert(impl::is_bitfield_type, + static_assert(impl::is_bitfield_type_v, "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, ""); -static_assert(!impl::is_bitfield_type, ""); -static_assert(!impl::is_bitfield_type, ""); -static_assert(!impl::is_bitfield_type, ""); -static_assert(!impl::is_bitfield_type, ""); +static_assert(impl::is_bitfield_type_v, ""); +static_assert(!impl::is_bitfield_type_v, ""); +static_assert(!impl::is_bitfield_type_v, ""); +static_assert(!impl::is_bitfield_type_v, ""); +static_assert(!impl::is_bitfield_type_v, ""); static_assert(impl::compute_mask<0, 0, std::uint32_t>() == 0x1, ""); static_assert(impl::compute_mask<4, 7, std::uint32_t>() == 0xf0, ""); -- cgit v1.2.3