Почему обратный итератор так медленно сравнивается с STD :: Reverse, затем итерация? ⇐ C++
-
Anonymous
Почему обратный итератор так медленно сравнивается с STD :: Reverse, затем итерация?
#include
#include
#include
using namespace std;
int v_size = 100000;
void foo1()
{
vectortest(v_size, 1);
auto start = GetTickCount();
reverse(test.begin(), test.end());
int h = 0;
for (auto& i : test)
{
i += h;
++h;
}
reverse(test.begin(), test.end());
auto end = GetTickCount();
cout
Подробнее здесь: https://stackoverflow.com/questions/653 ... en-iterate
#include
#include
#include
using namespace std;
int v_size = 100000;
void foo1()
{
vectortest(v_size, 1);
auto start = GetTickCount();
reverse(test.begin(), test.end());
int h = 0;
for (auto& i : test)
{
i += h;
++h;
}
reverse(test.begin(), test.end());
auto end = GetTickCount();
cout
Подробнее здесь: https://stackoverflow.com/questions/653 ... en-iterate
Мобильная версия