We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
format
args
#2462 fixed an inconsistency between signatures of format-family methods, in a way that now all of them accept args as universal references.
Unfortunately, universal references are not quite "universal" in that they can't be bound to bit fields, e.g.:
struct C { int f : 1; }; C c = {.f = 1}; void foo() { char buf[10]; format_to_n(buf, 10, "{}", c.f); // Compiles before #2462, no longer compiles now. }
This might be a long-standing issue with format and format_to, I suppose.
format_to
To fix this, I suggest that we should instead accept args as const references for all of format-family methods.
The text was updated successfully, but these errors were encountered:
人家才统一改成 universal referenece,你就来拆台了。
Sorry, something went wrong.
The choice to use forwarding references here is intentional to support formatting of ranges, see: https://wg21.link/p2418
Thanks for mentioning P2418, I wasn't aware of it.
No branches or pull requests
#2462 fixed an inconsistency between signatures of
format
-family methods, in a way that now all of them acceptargs
as universal references.Unfortunately, universal references are not quite "universal" in that they can't be bound to bit fields, e.g.:
This might be a long-standing issue with
format
andformat_to
, I suppose.To fix this, I suggest that we should instead accept
args
as const references for all offormat
-family methods.The text was updated successfully, but these errors were encountered: