This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/50501] Insertion of complex into a stream may fail without invalidating the stream
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Sep 2011 23:58:54 +0000
- Subject: [Bug libstdc++/50501] Insertion of complex into a stream may fail without invalidating the stream
- Auto-submitted: auto-generated
- References: <bug-50501-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50501
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-23 23:58:54 UTC ---
The Standard is very precise here, and nothing changed for C++11. It says,
literally:
Effects: inserts the complex number x onto the stream o as if it were
implemented as follows:
template<class T, class charT, class traits>
basic_ostream<charT, traits>&
operator<<(basic_ostream<charT, traits>& o, const complex<T>& x) {
basic_ostringstream<charT, traits> s;
s.flags(o.flags());
s.imbue(o.getloc());
s.precision(o.precision());
s << â(â << x.real() << "," << x.imag() << â)â;
return o << s.str();
}
thus, I don't see how we could to something else, like what you are suggesting,
and remain conforming.