[omniORB] Question on class Any

Zurek, Jan Jan.Zurek@dresdner-bank.com
Mon, 19 Oct 1998 17:36:20 +0200


Hi everybody!

Please have a look at the definition the following operator of class Any:
	void operator<<=( const char*& s );

Is there a reason why the s is declared as reference?
The HP-Compiler (aCC A.01.15) gives an error when compiling a code like the
following because the value passed as reference is not an lvalue:

const char* getit() { return "dodo" };

CORBA::Any myAny;
nyAny<<=getit;

When changing the parameter "s" in the operator from "const char*&" to
"const char*" everything (including the examples) compiles fine!

Regards
Jan Zurek
Dresdner Kleinwort Benson
Global Markets Division
Information Technology
Tel: 	+49 69 263 6318
Fax: 	+49 69 263 11454
e-mail:	jan.zurek@dresdner-bank.de
<http://www.ltt.de/ciow97/pr_oo_winners_e.html>