mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 00:21:13 +00:00
Simplify UDL
This commit is contained in:
parent
36d95c9fcc
commit
3c4273dd09
@ -3333,11 +3333,9 @@ inline namespace literals {
|
|||||||
\endrst
|
\endrst
|
||||||
*/
|
*/
|
||||||
# if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
# if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
||||||
template <detail_exported::fixed_string Str>
|
template <detail_exported::fixed_string Str> constexpr auto operator""_a() {
|
||||||
constexpr auto operator""_a()
|
using char_t = remove_cvref_t<decltype(Str.data[0])>;
|
||||||
-> detail::udl_arg<remove_cvref_t<decltype(Str.data[0])>,
|
return detail::udl_arg<char_t, sizeof(Str.data) / sizeof(char_t), Str>();
|
||||||
sizeof(Str.data) / sizeof(decltype(Str.data[0])), Str> {
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
constexpr auto operator"" _a(const char* s, size_t) -> detail::udl_arg<char> {
|
constexpr auto operator"" _a(const char* s, size_t) -> detail::udl_arg<char> {
|
||||||
|
Loading…
Reference in New Issue
Block a user