diff options
author | Freeyorp <TheFreeYorp+git@gmail.com> | 2024-06-19 11:28:25 +0000 |
---|---|---|
committer | Freeyorp <TheFreeYorp+git@gmail.com> | 2024-06-19 13:00:17 +0000 |
commit | 053aaa39b0625d374a22191d0468325ebbfa9706 (patch) | |
tree | a6f09fffb72e60eb63a4c74f760c474b515186f3 | |
parent | ffcede07624408128f0988c482619b988a7c41f3 (diff) | |
download | tmwa-053aaa39b0625d374a22191d0468325ebbfa9706.tar.gz tmwa-053aaa39b0625d374a22191d0468325ebbfa9706.tar.bz2 tmwa-053aaa39b0625d374a22191d0468325ebbfa9706.tar.xz tmwa-053aaa39b0625d374a22191d0468325ebbfa9706.zip |
strs: Literal storage lifetime for DEFAULT_EMAIL
-rw-r--r-- | src/mmo/strs.cpp | 5 | ||||
-rw-r--r-- | src/mmo/strs.hpp | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/mmo/strs.cpp b/src/mmo/strs.cpp index d780702..106de4a 100644 --- a/src/mmo/strs.cpp +++ b/src/mmo/strs.cpp @@ -20,11 +20,16 @@ #include "../io/cxxstdio.hpp" +#include "fwd.hpp" + #include "../poison.hpp" namespace tmwa { + +const AccountEmail DEFAULT_EMAIL = stringish<AccountEmail>("a@a.com"_s); + VString<49> convert_for_printf(NpcEvent ev) { return STRNPRINTF(50, "%s::%s"_fmt, ev.npc, ev.label); diff --git a/src/mmo/strs.hpp b/src/mmo/strs.hpp index 6a132c2..f24da72 100644 --- a/src/mmo/strs.hpp +++ b/src/mmo/strs.hpp @@ -38,7 +38,7 @@ struct ServerName : VString<19> {}; struct PartyName : VString<23> {}; struct VarName : VString<31> {}; -#define DEFAULT_EMAIL stringish<AccountEmail>("a@a.com"_s) +extern const AccountEmail DEFAULT_EMAIL; // It is decreed: a mapname shall not contain an extension class MapName : public strings::_crtp_string<MapName, MapName, strings::ZPair> |