From b40b23853b2311c5c5cd70406fef5277673ed308 Mon Sep 17 00:00:00 2001 From: DarkSharpness <2040703891@qq.com> Date: Thu, 11 Jul 2024 22:26:10 +0800 Subject: [PATCH] fix: fix the wrong type for static member "_Bit_Len" --- include/concept.h | 2 +- include/register.h | 2 +- include/wire.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/concept.h b/include/concept.h index 6eb123f..2145e9f 100644 --- a/include/concept.h +++ b/include/concept.h @@ -34,7 +34,7 @@ concept explicit_convertible_to = && std::constructible_from <_To, _From>; template -concept has_length = requires { _Tp::_Bit_Len; }; +concept has_length = requires { { +_Tp::_Bit_Len } -> std::same_as ; }; template concept bit_type = has_length <_Tp> && explicit_convertible_to <_Tp, max_size_t>; diff --git a/include/register.h b/include/register.h index f81849a..67220dd 100644 --- a/include/register.h +++ b/include/register.h @@ -26,7 +26,7 @@ struct Register { } public: - static constexpr bool _Bit_Len = _Len; + static constexpr std::size_t _Bit_Len = _Len; explicit Register() : _M_old(), _M_new(), _M_assigned() {} diff --git a/include/wire.h b/include/wire.h index 77bcb31..5c1bf7e 100644 --- a/include/wire.h +++ b/include/wire.h @@ -73,7 +73,7 @@ struct Wire { } public: - static constexpr bool _Bit_Len = _Len; + static constexpr std::size_t _Bit_Len = _Len; explicit Wire() : _M_func(new details::EmptyWire),