[omniORB] CORBA::String operator = (char *)

Liutger Franzen ilfranze@TechFak.Uni-Bielefeld.DE
Wed, 29 Jul 1998 13:37:22 +0200


Is it correct, that the operator = of CORBA::String differs when using a
(char *) compared to a (const char *)? I checked the source and found
that in the 1st case, the string is not copied. This is a bit annoying
when using stuff like:

	CORBA::String str;
	str = "foo";

In this case the "foo" is a (char *) (could not believe this 1st, but I
checked it with several compilers incl. g++) and you get into trouble if
you don't change it to:

	str = (const char *) "foo";

because CORBA::String will coredump when deleting "foo" ... any
suggestions? Or is this just my mistake?

-- 
Lio