sculpto
fixed_string.h
Go to the documentation of this file.
1/*!****************************************************************//*!*
2 * \file fixed_string.h
3 * \brief Fixed ;ength string class implementation module.
4 * Useful for class templates.
5 *
6 * \author Sabitov Kirill
7 * \date 26 June 2022
8 *********************************************************************/
9
10#pragma once
11
12namespace scl
13{
15 template <size_t N>
17 {
19 char value[N + 1] {};
20
22 constexpr fixed_string() = default;
23
24 /*!*
25 * Fixed string constructor bt char array.
26 *
27 * \param Str - char array.
28 */
29 constexpr fixed_string(const char (&Str)[N + 1])
30 {
31 std::copy_n(value, N + 1, Str);
32 }
33 };
34
36 template <size_t Length>
37 fixed_string(const char (&str)[Length]) -> fixed_string<Length - 1>;
38
39}
Definition: base.h:33
fixed_string(const char(&str)[Length]) -> fixed_string< Length - 1 >
constexpr fixed_string(const char(&Str)[N+1])
Definition: fixed_string.h:29
constexpr fixed_string()=default