microsoft / cppwinrt

C++/WinRT
MIT License
1.61k stars 232 forks source link

Remove double forward #1387

Closed sylveon closed 5 months ago

sylveon commented 6 months ago

This fixes the code analysis warnings pointed out by @dmachaj. We can't just really switch to using Args const&... because some types cannot be formatted as const lvalues - most notably ranges::filter_view. So instead, we take a forwarding reference, but don't actually call std::forward, resulting in all the arguments being passed to std::format as lvalue references.

Formatters that care about the exact value category should feel bad.

dmachaj commented 6 months ago

Looks like this change introduced some build breaks in the cpp20 test code :(

sylveon commented 6 months ago

Yeah, should've actually tested it haha. Lemme fix that.

sylveon commented 6 months ago

Should work now :)