Issue 731: IDL generated C++ types and stream operators (cxx_revision) Source: (, ) Nature: Uncategorized Issue Severity: Minor Summary: Summary: Most ORBs provide overloaded operators to inject String_var values into ostream, istream, on ifstream. Problem: C++ does not make these operators mandatory, so every time I use one of them, I am writing non-portable and proprietary code. Nail those operators down and make them mandatory in the spec Resolution: Fixed, requirements added Revised Text: Actions taken: September 24, 1997: received issue February 19, 1999: closed issue Discussion: End of Annotations:===== Return-Path: X-Authentication-Warning: foxtail.dstc.edu.au: michi owned process doing -bs Date: Wed, 24 Sep 1997 09:10:13 +1000 (EST) From: Michi Henning To: issues@omg.org, cxx_revision@omg.org, port-rtf@omg.org Subject: IDL generated C++ types and stream operators Hi, most ORBs provide overloaded operators to inject String_var values into ostream, istream, and ifstream. This allows me to write String_var s = CORBA::string_dup("Hello"); cout << s << endl; instead of the much uglier cout << (const char *)s << endl; The problem is that the C++ mapping does not make these operators mandatory, so every time I use one of them, I'm writing non-portable and proprietary code. Similar arguments apply to exceptions. Almost every ORB provides a way to inject an exception into an ostream, but the spec does not define the overloaded operators for this. What is worse, different vendors have chosen different ways of injecting exceptions onto ostreams, so we now have incompatibilities. There are also proprietary extensions for controlling the formatting of exceptions for printing. I think it would be a good idea for the spec to nail these operators down and to make them mandatory. Opinions? Cheers, Michi. -- Michi Henning +61 7 33654310 DSTC Pty Ltd +61 7 33654311 (fax) University of Qld 4072 michi@dstc.edu.au AUSTRALIA http://www.dstc.edu.au/BDU/staff/michi-henning.html