util/TemplateString: add FromLiteral()
This commit is contained in:
parent
b8df851414
commit
ad2c22844c
@ -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>
|
template<typename... Args>
|
||||||
constexpr auto
|
constexpr auto
|
||||||
Concat(Args... args) noexcept
|
Concat(Args... args) noexcept
|
||||||
|
Loading…
Reference in New Issue
Block a user