diff --git a/src/util/TemplateString.hxx b/src/util/TemplateString.hxx index 0c034fbba..447992242 100644 --- a/src/util/TemplateString.hxx +++ b/src/util/TemplateString.hxx @@ -108,6 +108,18 @@ copy_n(const char *src, std::size_t n, char *dest) noexcept } +/** + * A string consisting of a single character. + */ +template +constexpr auto +FromLiteral(const char (&src)[size]) noexcept +{ + Buffer result{}; + detail::copy_n(src, result.size, result.value); + return result; +} + template constexpr auto Concat(Args... args) noexcept