Skip to content

Commit 94ab51c

Browse files
authored
Simplify implementation of operator""_cf (#4349)
1 parent 0ca42e8 commit 94ab51c

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

include/fmt/compile.h

+1-13
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,6 @@ namespace detail {
4141
# define FMT_COMPILE(s) FMT_STRING(s)
4242
#endif
4343

44-
#if FMT_USE_NONTYPE_TEMPLATE_ARGS
45-
template <typename Char, size_t N, fmt::detail::fixed_string<Char, N> Str>
46-
struct udl_compiled_string : compiled_string {
47-
using char_type = Char;
48-
constexpr explicit operator basic_string_view<char_type>() const {
49-
return {Str.data, N - 1};
50-
}
51-
};
52-
#endif
53-
5444
template <typename T, typename... Tail>
5545
auto first(const T& value, const Tail&...) -> const T& {
5646
return value;
@@ -538,9 +528,7 @@ void print(const S& fmt, const Args&... args) {
538528
#if FMT_USE_NONTYPE_TEMPLATE_ARGS
539529
inline namespace literals {
540530
template <detail::fixed_string Str> constexpr auto operator""_cf() {
541-
using char_t = remove_cvref_t<decltype(Str.data[0])>;
542-
return detail::udl_compiled_string<char_t, sizeof(Str.data) / sizeof(char_t),
543-
Str>();
531+
return FMT_COMPILE(Str.data);
544532
}
545533
} // namespace literals
546534
#endif

0 commit comments

Comments
 (0)