2 #include <qvaluelist.h>
3 #include <qvaluevector.h>
9 void test_sharing(const T
& input
)
11 // a copy should increase the share counter
14 // a const interator should not detach the copy
15 typename
T::const_iterator cit
= copy
.constBegin();
16 std::cout
<< *cit
<< std::endl
;
18 // a non-const iterator should detach the copy
19 typename
T::iterator it
= copy
.begin();
20 std::cout
<< *it
<< std::endl
;
25 QMap
<QString
,int> str2int
;
27 test_sharing(str2int
);
33 QValueVector
<double> vals(6, 47.11);
37 QRect
r(10,20, 130, 240);
38 QPoint p
= r
.topLeft();
39 QPoint q
= r
.bottomRight();
40 std::cout
<< r
.width() << r
.height() << p
.x() << q
.y() << std::endl
;