File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =' 1.0' encoding =' utf-8' standalone =' no' ?>
2+ <!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+ <issue num =" 4364" status =" New" >
5+ <title >SFINAE-friendliness on <tt >operator<< </tt > and <tt >operator>> </tt > for unspecified I/O manipulators</title >
6+ <section >
7+ <sref ref =" [std.manip]" /><sref ref =" [ext.manip]" /><sref ref =" [quoted.manip]" />
8+ </section >
9+ <submitter >Jiang An</submitter >
10+ <date >05 Sep 2025</date >
11+ <priority >99</priority >
12+
13+ <discussion >
14+ <p >
15+ Currently, it is unspecified whether any of <tt >operator<< </tt > or <tt >operator>> </tt >
16+ for the "<i >unspecified</i >" return type of an I/O manipulating function is SFINAE-friendly.
17+ <p />
18+ There's implementation divergence. E.g. the following program is consistently rejected by
19+ implementations although the standard doesn't strictly require it to be ill-formed. Among
20+ the implementations, libstdc++ and libc++ make the failure SFINAE-friendly, while MSVC STL
21+ doesn't (<a href =" https://godbolt.org/z/rWYszoYa8" >demo</a >):
22+ </p >
23+ <blockquote ><pre >
24+ #include < iostream>
25+ #include < iomanip>
26+
27+ int main()
28+ {
29+ std::cout << std::setfill(L'*');
30+ }
31+ </pre ></blockquote >
32+ <p >
33+ It seems better to eliminate such implementation divergence. Perhaps it's also better to
34+ require them to be SFINAE-friendly to reduce potential conflicts with user-provided operators.
35+ <p />
36+ If it's intended to allow implementation divergence, perhaps we should clarify the intent.
37+ </p >
38+ </discussion >
39+
40+ <resolution >
41+ </resolution >
42+
43+ </issue >
You can’t perform that action at this time.
0 commit comments