On Fri, Dec 14, 2001 at 11:50:20AM +0100, Herbert Voss wrote: > On Fri, 14 Dec 2001, Lars Gullik [iso-8859-1] Bjønnes wrote: > > > | + VSpace value = VSpace(lex.getString()); > > > > VSpace value(lex.getString); > > where is the difference?
The main difference is that the latter won't work unless you add () after getString. The lesser difference (after fixing the main difference) is that the former will construct a temporary VSpace object and use the copy-constructor to construct "value" from this temporary whereas the latter directly constructs the object. So the latter might be more efficient. "might" because the compiler might optimize away the temporary, so the result could be identical. And there are the usual religious wars and syntactic quirks that make people lean to one side or another... > in Java it doesn't matter. Because the Java "object" is in fact only a pointer to some object with neglectible costs for copying... Andre' -- André Pönitz .............................................. [EMAIL PROTECTED]