mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Use forwarding references in UDL template
This commit is contained in:
parent
d0f2f3b816
commit
ad71f5a706
@ -3455,13 +3455,13 @@ namespace internal {
|
|||||||
template <typename Char, Char... CHARS> class udl_formatter {
|
template <typename Char, Char... CHARS> class udl_formatter {
|
||||||
public:
|
public:
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
std::basic_string<Char> operator()(const Args&... args) const {
|
std::basic_string<Char> operator()(Args&&... args) const {
|
||||||
FMT_CONSTEXPR_DECL Char s[] = {CHARS..., '\0'};
|
FMT_CONSTEXPR_DECL Char s[] = {CHARS..., '\0'};
|
||||||
FMT_CONSTEXPR_DECL bool invalid_format =
|
FMT_CONSTEXPR_DECL bool invalid_format =
|
||||||
do_check_format_string<Char, error_handler, Args...>(
|
do_check_format_string<Char, error_handler, Args...>(
|
||||||
basic_string_view<Char>(s, sizeof...(CHARS)));
|
basic_string_view<Char>(s, sizeof...(CHARS)));
|
||||||
(void)invalid_format;
|
(void)invalid_format;
|
||||||
return format(s, args...);
|
return format(s, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
# else
|
# else
|
||||||
|
Loading…
Reference in New Issue
Block a user