[omniORB] [AGAIN] Ambiguous conversion operators in OmniORB 4

m.soukhanov@geosys.ru m.soukhanov@geosys.ru
Fri, 15 Feb 2002 14:21:40 +0300


Hello!

This problem was already mentioned on the list by Carl Tompson: <http://www.uk.research.att.com/omniORB/archives/2001-11/0122.html>, but he did not get any reply then.

While compiling an SK.cc stub generated by omniidl:

[C++ Error] MyStructSK.cc(267): E2015 Ambiguity between 'MyStruct_var::operator const MyStruct &() const' and 'MyStruct_var::operator MyStruct &()' 

265: void _0RL_cd_d82bd7526d83a333_20000000::marshalReturnedValues(cdrStream& _n)
266: {
267:   (const MyStruct&) result >>= _n;
268: }

The problem is that MyStruct_var (named 'result' here) is non-const and neither conversion operators fits "better". The same applies for sequence _vars and maybe some other types _vars (and _ptrs). Carl found these error with "the 
very latest versions of GCC", and now Borland C++ complains about it too. Though it is not an official platform, omniORB 4 for Borland C++(Builder) is now fully functional and working.

Also, was I safe to comment out the 'const' modifier as a temporaly work-around? as follows:

267:   (/*const*/ MyStruct&) result >>= _n;

Best regards,
		Mikhail

Dr. Mikhail Soukhanov <mailto:m.soukhanov@geosys.ru.>

Laboratorija Geoinformatiki, VNIIgeosistem
Warszawskoje chaussee 8, Moskva M-105, 113105 Rossija
Tel.: +7(095) 954-21-50 (x101), fax.: +7(095) 958-35-22
W.W.W.: <http://www.geosys.ru./>