31 void StlizeTest::testConst ()
36 for (
const auto& pair : Util::
Stlize (map))
42 void StlizeTest::testNonConst ()
47 for (
const auto& pair : Util::
Stlize (map))
53 void StlizeTest::testNonConstModify ()
67 for (
const auto& pair : Util::
Stlize (map))
74 QCOMPARE (
true, (std::all_of (map.begin (), map.end (), [] (
const QString&
str) { return str.isEmpty (); })));
77 void StlizeTest::testRvalue ()
86 void StlizeTest::testAnyOf ()
90 [] (
const auto& pair) { return pair.second ==
"bbb"; });
100 for (
int i = 0;
i < 1500000; ++
i)
106 void StlizeTest::benchmarkPlain ()
110 volatile int sum = 0;
111 for (
auto value : map)
116 void StlizeTest::benchmarkStlized ()
120 volatile int sum = 0;
121 for (
const auto& pair : Util::
Stlize (map))
auto Stlize(Assoc &&assoc) noexcept
Converts an Qt's associative sequence assoc to an STL-like iteratable range.
Container< T > Filter(const Container< T > &c, F f)