From 1dfeb5eff2246a37c0afbb725d157c3ca08145d8 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Fri, 7 Feb 2025 20:41:44 -0600 Subject: [PATCH] Base: Add comments to new macros --- src/Base/XMLTools.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Base/XMLTools.h b/src/Base/XMLTools.h index 621015ae10..3ff23b5293 100644 --- a/src/Base/XMLTools.h +++ b/src/Base/XMLTools.h @@ -174,6 +174,9 @@ inline XStr::~XStr() XERCES_CPP_NAMESPACE_QUALIFIER XMLString::release(&fUnicodeForm); } +// Uses the compiler to create a cache of transcoded string literals so that each subsequent call +// can re-use the data from the lambda's initial creation. Permits the same usage as +// XStr("literal").unicodeForm() #define XStrLiteral(literal) \ ([]() -> const XStr& { \ static const XStr str {literal}; \ @@ -216,6 +219,9 @@ inline XUTF8Str::XUTF8Str(const char* const fromTranscode) inline XUTF8Str::~XUTF8Str() = default; +// Uses the compiler to create a cache of transcoded string literals so that each subsequent call +// can re-use the data from the lambda's initial creation. Permits the same usage as +// XStr("literal").unicodeForm() #define XUTF8StrLiteral(literal) \ ([]() -> const XUTF8Str& { \ static const XUTF8Str str {literal}; \