本文整理汇总了C++中Coordinates::removeAll方法的典型用法代码示例。如果您正苦于以下问题:C++ Coordinates::removeAll方法的具体用法?C++ Coordinates::removeAll怎么用?C++ Coordinates::removeAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Coordinates
的用法示例。
在下文中一共展示了Coordinates::removeAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QVERIFY
void Coordinates_test::
t_search()
{
Coordinates c;
c << 1.0 << 3.0 << 1.0;
QVERIFY(c.contains(1.0));
QVERIFY(c.contains(3.0));
QVERIFY(!c.contains(0.0));
QCOMPARE(c.count(1.0), 2);
QCOMPARE(c.count(3.0), 1);
QCOMPARE(c.count(0.0), 0);
QCOMPARE(c.indexOf(1.0), 0);
QCOMPARE(c.indexOf(3.0), 1);
QCOMPARE(c.indexOf(1.0, -1), 2);
QCOMPARE(c.indexOf(3.0, -1), -1);
QCOMPARE(c.indexOf(3.0, -2), 1);
QCOMPARE(c.indexOf(1.0, -3), 0);
QCOMPARE(c.indexOf(1.0, -4), 0);
QCOMPARE(c.indexOf(1.0, 1), 2);
QCOMPARE(c.indexOf(3.0, 2), -1);
QCOMPARE(c.indexOf(1.0, 2), 2);
QCOMPARE(c.indexOf(1.0, 3), -1);
QCOMPARE(c.indexOf(1.0, 4), -1);
QCOMPARE(c.lastIndexOf(1.0), 2);
QCOMPARE(c.lastIndexOf(3.0), 1);
QCOMPARE(c.lastIndexOf(1.0, -1), 2);
QCOMPARE(c.lastIndexOf(3.0, -1), 1);
QCOMPARE(c.lastIndexOf(3.0, -2), 1);
QCOMPARE(c.lastIndexOf(1.0, -3), 0);
QCOMPARE(c.lastIndexOf(1.0, -4), -1);
QCOMPARE(c.lastIndexOf(1.0, 1), 0);
QCOMPARE(c.lastIndexOf(3.0, 2), 1);
QCOMPARE(c.lastIndexOf(1.0, 2), 2);
QCOMPARE(c.lastIndexOf(1.0, 3), 2);
QCOMPARE(c.lastIndexOf(1.0, 4), 2);
c.removeAll(3.0);
QCOMPARE(c.count(), 2);
c.removeAll(4.0);
QCOMPARE(c.count(), 2);
c.removeAll(1.0);
QCOMPARE(c.count(), 0);
c.removeAll(4.0);
QCOMPARE(c.count(), 0);
}//t_search