-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStringWrap.h
More file actions
54 lines (38 loc) · 1.21 KB
/
StringWrap.h
File metadata and controls
54 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include <string>
struct StrWrap
{
const std::string m_str;
const std::string& sstr() const;
StrWrap(const std::string& pStr);
};
// 'StrWrapA' - String-Wrapper, only constructors for testing.
struct StrWrapA : public StrWrap
{
constexpr static std::string_view struct_ = "StrWrapA";
StrWrapA();
StrWrapA(std::string_view pStr); // (1) by value
StrWrapA(std::string& pStr); // (2) lvalue ref
StrWrapA(const std::string& pStr); // (3) const lvalue ref
StrWrapA(std::string&& pStr); // (4) rvalue ref
StrWrapA(const char* pStr); // (5) pointer
};
// 'StrWrapB' - String-Wrapper, only constructors for testing.
struct StrWrapB : public StrWrap
{
constexpr static std::string_view struct_ = "StrWrapB";
StrWrapB(std::string& pStr);
StrWrapB(const std::string& pStr);
};
// 'StrWrapC' - String-Wrapper, only constructors for testing.
struct StrWrapC : public StrWrap
{
constexpr static std::string_view struct_ = "StrWrapC";
StrWrapC(std::string& pStr);
};
// 'StrWrapD' - String-Wrapper, only constructors for testing.
struct StrWrapD : public StrWrap
{
constexpr static std::string_view struct_ = "StrWrapD";
StrWrapD(const std::string& pStr);
};