From daadccebe0a276660293c1aecc124cd81398b052 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 17 Oct 2023 08:25:13 +0200 Subject: [PATCH] refactor: additional constraints added to the `fixed_string(CharT)` constructor --- src/core/include/mp-units/bits/external/fixed_string.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/include/mp-units/bits/external/fixed_string.h b/src/core/include/mp-units/bits/external/fixed_string.h index 0554a0e2..eb7a6110 100644 --- a/src/core/include/mp-units/bits/external/fixed_string.h +++ b/src/core/include/mp-units/bits/external/fixed_string.h @@ -48,7 +48,11 @@ struct basic_fixed_string { using const_iterator = const CharT*; - constexpr explicit(false) basic_fixed_string(CharT ch) noexcept { data_[0] = ch; } + constexpr explicit(false) basic_fixed_string(CharT ch) noexcept + requires(N == 1) + { + data_[0] = ch; + } constexpr explicit(false) basic_fixed_string(const CharT (&txt)[N + 1]) noexcept {