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


On 04/25/2014 07:55 AM, julien2412 wrote:
Seeing the number of times getCppuType is used, I've got several questions
about this:
- what's the use of it? It resembles at the first look to "typeid" but I
suppose it's not this.

Yes, it's to the C++ UNO language binding what typeid is to C++, mapping from a C++ type representing a UNO type to a css::uno::Type instance describing that UNO type.

getCppuType is not without flaws though, and cppu::UnoType should be used instead.

- could there be an alternative? (eg a more "native"/straightforward C++
way)?

Not really.

- if it still must be used, could the C style cast be changed in static cast
(to be sure the cast is in build time and so the check is also  in build
time)?

What cast are you talking about? The one in the typical usage like getCppuType((T*)0)? Sure, nothing keeps you from writing that as getCppuType(static_cast<T*>(0)), or better yet, cppu::UnoType<T>::get(), instead.

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.