File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,21 +186,27 @@ template <size_t Size>
186186class text_t
187187{
188188public:
189- std::array<uint8_t , Size - 1 > data;
190189 CONSTEVAL text_t (const char (&string)[Size]) noexcept
191- : data(to_array(string)) {}
190+ : data(to_array(string))
191+ {
192+ }
193+
194+ const std::array<uint8_t , Size - 1 > data;
192195
193196private:
194197 static CONSTEVAL auto to_array (const char (&string)[Size]) noexcept
195198 {
196- std::array<uint8_t , Size - 1 > data {};
197- for (size_t index = 0 ; index < Size - 1 ; ++index)
198- data. at ( index) = string[index];
199+ std::array<uint8_t , Size - 1 > out {};
200+ for (size_t index{} ; index < Size - 1 ; ++index)
201+ out[ index] = string[index];
199202
200- return data ;
203+ return out ;
201204 }
202205};
203206
207+ template <size_t Size>
208+ text_t (const char (&)[Size]) noexcept -> text_t<Size>;
209+
204210template <size_t Size, typename Byte,
205211 std::enable_if_t <std::is_same_v<Byte, char >, bool > = true >
206212constexpr size_t literal_length (const Byte (&)[Size]) noexcept
You can’t perform that action at this time.
0 commit comments