| Type | required |
| Title | getCppuType superseded by cppu::UnoType and cppu::getTypeFavourUnsigned |
| Posted by | [EMAIL PROTECTED] |
| Affected | ,- |
| Effective from | SRC680 CWS sb41 |
Summary
+ cppu/unotype.hxx:
+ struct cppu::UnoVoidType;
+ struct cppu::UnoUnsignedShortType;
+ struct cppu::UnoCharType;
+ template< typename > struct cppu::UnoSequenceType;
+ com::sun::star::uno::Type const & cppu::UnoType< T >::get()
+ com::sun::star::uno::Type const & getTypeFavourUnsigned(T const *)
Description
In many cases, using getCppuType within templates does not work (but
many compilers are broken, so this problem was not noticed until GCC
4.1 came along). To solve the problem, getCppuType has been
superseded by the new cppu::UnoType and cppu::getTypeFavourUnsigned.
From the documentation of cppu::UnoType:
<quote>
For each C++ type representing a UNO type, the corresponding
instantiation of this template has a public static member function
get(). (The template is specialized for C++ templates representing
polymorphic struct type templates of UNO. In those cases, it does not
work to instantiate UnoType with a C++ type that is derived from a C++
type that represents a UNO type, but does not itself represent a UNO
type. In all other cases, UnoType even works for such C++ types that
are unambiguously derived from one C++ type that represents a UNO
type.) In addition to those C++ types that are mappings of UNO types
(except for sal_uInt16 and sal_Unicode, see below), the following C++
types are appropriate as template arguments: cppu::UnoVoidType, bool,
cppu::UnoUnsignedShortType, cppu::UnoCharType, cppu::UnoSequenceType
with any appropriate template argument (the latter three to
unambiguously specify UNO types, as the UNO types UNSIGNED SHORT and
CHAR map to the same C++ type), and com::sun::star::uno::Reference
with any appropriate template argument.
</quote>
From the documentation of cppu::getTypeFavourUnsigned:
<quote>
There are three overloads of this function that together form the
replacement of getCppuType. The replacement has exactly the same
semantics as getCppuType, in that it returns correct results for the
UNO type UNSIGNED SHORT but not for the UNO type CHAR.
</quote>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
