sculpto
Main Page
Namespaces
Classes
Files
File List
File Members
utilities
string
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
12
namespace
scl
13
{
15
template
<
size_t
N>
16
struct
fixed_string
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
}
scl
Definition:
base.h:33
scl::fixed_string
fixed_string(const char(&str)[Length]) -> fixed_string< Length - 1 >
scl::keycode::N
@ N
scl::fixed_string
Definition:
fixed_string.h:17
scl::fixed_string::fixed_string
constexpr fixed_string(const char(&Str)[N+1])
Definition:
fixed_string.h:29
scl::fixed_string::fixed_string
constexpr fixed_string()=default
scl::fixed_string::value
char value[N+1]
Definition:
fixed_string.h:19
Generated by
1.9.4