mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 12:14:26 +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 {
|
||||
public:
|
||||
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 bool invalid_format =
|
||||
do_check_format_string<Char, error_handler, Args...>(
|
||||
basic_string_view<Char>(s, sizeof...(CHARS)));
|
||||
(void)invalid_format;
|
||||
return format(s, args...);
|
||||
return format(s, std::forward<Args>(args)...);
|
||||
}
|
||||
};
|
||||
# else
|
||||
|
Loading…
Reference in New Issue
Block a user