Hi Rainman,
> I have another ideal, it is better and safer than the last one I mentioned.
> I add a conversion operator to Reference, instead of a constructor, here is
> it:
>
> template < class base_interface_type >
> inline SAL_CALL operator const Reference< base_interface_type > ()
> const SAL_THROW( () )
> { return Reference< base_interface_type >( get() ); }
>
> I tested some cases, and it works well.
> How do you think it? I am not very sure it will work for all situation.
Uhm - implicit conversion operators are Evil (TM) :)
This is a place where my gut feeling says we should sacrifice the little
convenience we could gain (xA = xB instead of xA = xB.get()) for
clarity. At least clarity in reading code, but also clarity in reading
the error messages which the compiler would raise for incompatible xA
and xB :)
Admittedly, this feeling is not backed up by strong arguments, but I am
sure others could come up with some. Stephan?
Btw, did you compile the complete OOo from scratch with this change?
Would be interesting to know whether the existing code already survives it.
Ciao
Frank
--
- Frank Schönheit, Software Engineer [email protected] -
- Sun Microsystems http://www.sun.com/staroffice -
- OpenOffice.org Base http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]