Remove unused qMetaType helpers.

These function were replaced by QMetaTypeFunctionHelper class that is
a bit more flexible.

Change-Id: I5aee2089f543b6e05c4d65a688fa8ca721f8abe0
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Jędrzej Nowacki 2012-09-21 14:08:50 +02:00 committed by The Qt Project
parent 1c9b0eb640
commit 82cc324762

View File

@ -367,13 +367,6 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaType::TypeFlags)
template <typename T>
void qMetaTypeDeleteHelper(void *t)
{
delete static_cast<T*>(t);
}
template <> inline void qMetaTypeDeleteHelper<void>(void *) {}
namespace QtMetaTypePrivate {
template <typename T, bool Accepted = true>
struct QMetaTypeFunctionHelper {
@ -431,53 +424,6 @@ struct QMetaTypeFunctionHelper<void, /* Accepted */ true>
{};
}
template <typename T>
void *qMetaTypeCreateHelper(const void *t)
{
if (t)
return new T(*static_cast<const T*>(t));
return new T();
}
template <> inline void *qMetaTypeCreateHelper<void>(const void *) { return 0; }
template <typename T>
void qMetaTypeDestructHelper(void *t)
{
Q_UNUSED(t) // Silence MSVC that warns for POD types.
static_cast<T*>(t)->~T();
}
template <> inline void qMetaTypeDestructHelper<void>(void *) {}
template <typename T>
void *qMetaTypeConstructHelper(void *where, const void *t)
{
if (t)
return new (where) T(*static_cast<const T*>(t));
return new (where) T;
}
template <> inline void *qMetaTypeConstructHelper<void>(void *, const void *) { return 0; }
#ifndef QT_NO_DATASTREAM
template <typename T>
void qMetaTypeSaveHelper(QDataStream &stream, const void *t)
{
stream << *static_cast<const T*>(t);
}
template <> inline void qMetaTypeSaveHelper<void>(QDataStream &, const void *) {}
template <typename T>
void qMetaTypeLoadHelper(QDataStream &stream, void *t)
{
stream >> *static_cast<T*>(t);
}
template <> inline void qMetaTypeLoadHelper<void>(QDataStream &, void *) {}
#endif // QT_NO_DATASTREAM
class QObject;
class QWidget;
template <class T> class QSharedPointer;