Commit ad2c2284 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

util/TemplateString: add FromLiteral()

parent b8df8514
......@@ -108,6 +108,18 @@ copy_n(const char *src, std::size_t n, char *dest) noexcept
}
/**
* A string consisting of a single character.
*/
template<std::size_t size>
constexpr auto
FromLiteral(const char (&src)[size]) noexcept
{
Buffer<size - 1> result{};
detail::copy_n(src, result.size, result.value);
return result;
}
template<typename... Args>
constexpr auto
Concat(Args... args) noexcept
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment