|
utf-42
|
Compile-time polymorphic string literals for modern C++
utf-42 is a small, header-only C++ utility that allows you to define a string once and obtain it as a std::basic_string_view of any character type (char, wchar_t, char8_t, char16_t, char32_t) entirely at compile time.
It achieves this by leveraging the compilerβs built-in handling of Unicode string literal prefixes ("", L"", u8"", u"", U"") and selecting the appropriate encoding using consteval dispatch.
The result is zero runtime overhead, no heap allocation, and no runtime Unicode transcoding.