typedef T* iterator;
typedef const T* const_iterator;
#endif
- inline iterator begin() { detach(); return p->array; }
- inline const_iterator begin() const { return p->array; }
- inline const_iterator cbegin() const { return p->array; }
- inline const_iterator constBegin() const { return p->array; }
- inline iterator end() { detach(); return p->array + d->size; }
- inline const_iterator end() const { return p->array + d->size; }
- inline const_iterator cend() const { return p->array + d->size; }
- inline const_iterator constEnd() const { return p->array + d->size; }
+ inline iterator begin() { detach(); return d->begin(); }
+ inline const_iterator begin() const { return d->begin(); }
++ inline const_iterator cbegin() const { return d->begin(); }
+ inline const_iterator constBegin() const { return d->begin(); }
+ inline iterator end() { detach(); return d->end(); }
+ inline const_iterator end() const { return d->end(); }
++ inline const_iterator cend() const { return d->end(); }
+ inline const_iterator constEnd() const { return d->end(); }
iterator insert(iterator before, int n, const T &x);
inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); }
iterator erase(iterator begin, iterator end);
void tst_QMetaType::sizeOf_data()
{
QTest::addColumn<QMetaType::Type>("type");
- QTest::addColumn<int>("size");
+ QTest::addColumn<size_t>("size");
+
- QTest::newRow("QMetaType::UnknownType") << QMetaType::UnknownType << 0;
++ QTest::newRow("QMetaType::UnknownType") << QMetaType::UnknownType << size_t(0);
#define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \
- QTest::newRow(#RealType) << QMetaType::MetaTypeName << int(QTypeInfo<RealType>::sizeOf);
+ QTest::newRow(#RealType) << QMetaType::MetaTypeName << size_t(QTypeInfo<RealType>::sizeOf);
FOR_EACH_CORE_METATYPE(ADD_METATYPE_TEST_ROW)
#undef ADD_METATYPE_TEST_ROW
+
+ QTest::newRow("Whity<double>") << static_cast<QMetaType::Type>(::qMetaTypeId<Whity<double> >()) << sizeof(Whity<double>);
+ QTest::newRow("Whity<int>") << static_cast<QMetaType::Type>(::qMetaTypeId<Whity<int> >()) << sizeof(Whity<int>);
+ QTest::newRow("Testspace::Foo") << static_cast<QMetaType::Type>(::qMetaTypeId<TestSpace::Foo>()) << sizeof(TestSpace::Foo);
+
+ QTest::newRow("-1") << QMetaType::Type(-1) << size_t(0);
+ QTest::newRow("-124125534") << QMetaType::Type(-124125534) << size_t(0);
+ QTest::newRow("124125534") << QMetaType::Type(124125534) << size_t(0);
}
void tst_QMetaType::sizeOf()