tst_containerapisymmetry: use an algorithm
In preparation for the next changes. Change-Id: Ibe0635dfa040842073749aa3e2ae140f27dc983a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
b2ea30dde0
commit
dc091e7443
@ -608,9 +608,9 @@ template <typename Container>
|
||||
Container make(int size)
|
||||
{
|
||||
Container c;
|
||||
int i = 1;
|
||||
while (size--)
|
||||
c.push_back(typename Container::value_type(i++));
|
||||
c.reserve(size);
|
||||
using V = typename Container::value_type;
|
||||
std::generate_n(std::inserter(c, c.end()), size, [i = 1]() mutable { return V(i++); });
|
||||
return c;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user