This patch fixes LWG issue 2221 by adding a nullptr overload to basic_ostream.
Details
Diff Detail
Event Timeline
include/ostream | ||
---|---|---|
219 | We externally instantiate the rest of these methods, but we can't do that here (for backwards compat reasons). You need to add _LIBCPP_INLINE_VISIBILITY and maybe put it at the bottom of the group because it's unique in this way. | |
714 | inline or just define the thing inside the class. | |
717 | static_cast<const void*>(nullptr); But I'm not sure we want to forward to the const void* overload. My understanding of that overload is that it exists to print "bool" values for types like ostream that used to implement if (stream) via a conversion to void*. I think we may just want to print nill. | |
test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp | ||
74 | I don't think this test is portable. Implementations can print null or nill or "hubbabalo" for that matter. |
include/ostream | ||
---|---|---|
717 | I suggested this approach to Zoe, because I thought that that was what GCC did. (print 0x0) | |
test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp | ||
74 | Agreed. |
Once you fix the nits, I think this is good to go.
Be sure to update www/cxx1z_status.html as well.
include/ostream | ||
---|---|---|
224 | Don't need the \0; the compiler does that for you. { return *this << "nullptr"; } |
- update status
- fix operator implementation
include/ostream | ||
---|---|---|
224 | 🤦♂️but I liked the static_cast so much \s. |
We externally instantiate the rest of these methods, but we can't do that here (for backwards compat reasons).
You need to add _LIBCPP_INLINE_VISIBILITY and maybe put it at the bottom of the group because it's unique in this way.