On Sunday, 17 de July de 2011 23:50:26 Konstantin Ritt wrote:
> why not something simple like:
>
> template <typename T> inline bool QVariant::canConvert() const
> { return m_type >= QVariant::User ? qVariantCanConvert<T>(*this) : /*
> internal implementation */; }
> template <typename T> inline T QVariant::convert() const
> { return m_type >= QVariant::User ? qVariantValue<T>(*this) : /* internal
> implementation */; }
> ?
> it makes it possible to convert to an arbitrary type rather than just to
> QString...
Go ahead and try this.
Be sure to test with several compilers, as template programming usually finds
different behaviours in compilers.
Or you can declare a C++0x-only feature, like some of the QString work we've
done.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
