Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On 04/30/2013 05:55 PM, Thorsten Behrens wrote:
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...

So I came up in parallel with <https://gerrit.libreoffice.org/#/c/3699/> that does not require to include Boost headers in URE headers (though at the expense of borrowing some concepts from boost::is_base_and_derived, ultimately to be cleaned up with C++11 std::is_base_of), coexists happily with the Reference<XInterface> conversion operator, doesn't require changes all over the place (compared to Noel's <https://gerrit.libreoffice.org/#/c/3613/> I started it off from), doesn't use queryInterface internally (but thus doesn't support ambiguous up-casts in MI scenarios).

I'm giving it a try currently on the gerrit bulidbots (and will be back next Monday to discuss further).

Stephan


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.