Commit ad71f5a7 authored by Charles Milette's avatar Charles Milette Committed by Victor Zverovich

Use forwarding references in UDL template

parent d0f2f3b8
...@@ -3455,13 +3455,13 @@ namespace internal { ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment