You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For followup after #4611 implementing #4524 is merged.
This PR is implementing the Standard's "Effects equivalent to" wording which is simple and unquestionably correct.
However, blank-line println() is likely to be a popular function to call, and it appears that it goes through a general codepath that does a lot of work:
However, it is unclear to me whether we could further optimize this (without spending tons of complicated code). In particular, because we know that "\n" doesn't contain any exotic characters, could we simply call _Print_noformat_nonunicode?
For <ostream>, I believe that less thought is necessary:
_STD _Print_noformat(_Ostr, _Unescaped_str) eventually switches between Unicode and non-Unicode, but it has to construct ostream::sentry machinery first, so it wouldn't be worth digging any deeper.
The text was updated successfully, but these errors were encountered:
For followup after #4611 implementing #4524 is merged.
This PR is implementing the Standard's "Effects equivalent to" wording which is simple and unquestionably correct.
However, blank-line
println()
is likely to be a popular function to call, and it appears that it goes through a general codepath that does a lot of work:STL/stl/inc/print
Lines 97 to 117 in 0515a05
The optimizer is unlikely to see all the way through this.
From a brief glance, it appears that we could provide the newline as a
string_view
, bypassing the construction of astring _Unescaped_str
:STL/stl/inc/print
Lines 111 to 115 in 0515a05
However, it is unclear to me whether we could further optimize this (without spending tons of complicated code). In particular, because we know that
"\n"
doesn't contain any exotic characters, could we simply call_Print_noformat_nonunicode
?For
<ostream>
, I believe that less thought is necessary:STL/stl/inc/ostream
Lines 1246 to 1263 in 0515a05
_STD _Print_noformat(_Ostr, _Unescaped_str)
eventually switches between Unicode and non-Unicode, but it has to constructostream::sentry
machinery first, so it wouldn't be worth digging any deeper.The text was updated successfully, but these errors were encountered: