conversion operators for UNO

Thorsten Behrens thb at documentfoundation.org
Tue Apr 30 08:55:13 PDT 2013


> On 04/25/2013 10:35 AM, Noel Grandin wrote:
> >I want to change things so that I can write:
> >   void bar() {
> >       Reference<B> b = ....
> >       methodThatTakesA( b );
> >   }
>
Yeah. One of my older pet peeves...

Stephan Bergmann wrote:
> This has been discussed before more than once, but I tend to forget
> whether it has never gone past discussion stage because the
> implementation would be slightly tricky (using SFNIAE to restrict
> implicit conversions from Reference<B> to Reference<A> to cases
> where B is derived from A) or because there was some fundamental
> flaw with it.
>
Works by and large with the proof of concept from

 https://gerrit.libreoffice.org/#/c/3698/

, the only problem I recall, is a slight performance degradation,
since IIRC then operator Reference<XInterface>& needs to go due to
ambiguities (which avoids temporaries). Possibly offset nicely by
needing much less queryInterfaces...

Cheers,

-- Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20130430/9e05ab37/attachment.pgp>


More information about the LibreOffice mailing list