summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-06-16 20:02:29 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2018-06-16 20:04:29 +0100
commit9a0a7b1093c50d06461d2f355b1f2d8c03d1da5c (patch)
tree069447fe17f011f3b482f28edd9660581757a8fe
parentUse check, not require in CTF tests (diff)
downloadlibadhocutil-9a0a7b1093c50d06461d2f355b1f2d8c03d1da5c.tar.bz2
libadhocutil-9a0a7b1093c50d06461d2f355b1f2d8c03d1da5c.tar.xz
libadhocutil-9a0a7b1093c50d06461d2f355b1f2d8c03d1da5c.zip
Template strings don't need to be extern C++17, just constexpr
-rw-r--r--libadhocutil/compileTimeFormatter.h2
-rw-r--r--libadhocutil/unittests/testCompileTimeFormatter.cpp36
2 files changed, 19 insertions, 19 deletions
diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h
index 17af36d..6e85f8e 100644
--- a/libadhocutil/compileTimeFormatter.h
+++ b/libadhocutil/compileTimeFormatter.h
@@ -227,7 +227,7 @@ namespace AdHoc {
}
#define AdHocFormatterTypedef(name, str, id) \
- inline extern constexpr auto id = str; \
+ inline constexpr auto id = str; \
typedef ::AdHoc::Formatter<id> name
#define AdHocFormatter(name, str) \
AdHocFormatterTypedef(name, str, MAKE_UNIQUE(name))
diff --git a/libadhocutil/unittests/testCompileTimeFormatter.cpp b/libadhocutil/unittests/testCompileTimeFormatter.cpp
index 9089243..cb49bd2 100644
--- a/libadhocutil/unittests/testCompileTimeFormatter.cpp
+++ b/libadhocutil/unittests/testCompileTimeFormatter.cpp
@@ -7,24 +7,24 @@
using namespace AdHoc;
-extern constexpr const char * formatEdgeCaseEmpty = "";
-extern constexpr const char * formatEdgeCaseSingle = "1";
-extern constexpr const char * formatEdgeCaseFormatStart = "%? after";
-extern constexpr const char * formatEdgeCaseFormatEnd = "before %?";
-extern constexpr const char * formatEdgeCaseFormatLonely = "%?";
-extern constexpr const char * formatStringLiteral = "literal";
-extern constexpr const char * formatStringSingle = "single %?.";
-extern constexpr const char * formatStringMulti = "First %?, then %?.";
-extern constexpr const char * formatStringCustom = "custom %()";
-extern constexpr const char * formatStringCustomParam1 = "custom %(\x3)";
-extern constexpr const char * formatStringCustomParam2 = "custom %(\x9)";
-extern constexpr const char * formatStringCustomLong = "custom %(longname)";
-extern constexpr const char * formatStringLong = " ";
-extern constexpr const char * formatStringMultiArg = "value%ra";
-extern constexpr const char * formatStringEscape1 = "literal %% percentage.";
-extern constexpr const char * formatStringEscape2 = "literal %%? percentage.";
-extern constexpr const char * formatStringEscape3 = "literal %%%? percentage.";
-extern constexpr const char * formatStringEscape4 = "literal %%%?%% percentage.";
+constexpr const char * formatEdgeCaseEmpty = "";
+constexpr const char * formatEdgeCaseSingle = "1";
+constexpr const char * formatEdgeCaseFormatStart = "%? after";
+constexpr const char * formatEdgeCaseFormatEnd = "before %?";
+constexpr const char * formatEdgeCaseFormatLonely = "%?";
+constexpr const char * formatStringLiteral = "literal";
+constexpr const char * formatStringSingle = "single %?.";
+constexpr const char * formatStringMulti = "First %?, then %?.";
+constexpr const char * formatStringCustom = "custom %()";
+constexpr const char * formatStringCustomParam1 = "custom %(\x3)";
+constexpr const char * formatStringCustomParam2 = "custom %(\x9)";
+constexpr const char * formatStringCustomLong = "custom %(longname)";
+constexpr const char * formatStringLong = " ";
+constexpr const char * formatStringMultiArg = "value%ra";
+constexpr const char * formatStringEscape1 = "literal %% percentage.";
+constexpr const char * formatStringEscape2 = "literal %%? percentage.";
+constexpr const char * formatStringEscape3 = "literal %%%? percentage.";
+constexpr const char * formatStringEscape4 = "literal %%%?%% percentage.";
namespace AdHoc {
// Custom stream writer formatter, formats as