From 3e212a01d1ffe635670ea746b3b4bd725a63fd9c Mon Sep 17 00:00:00 2001 From: Sergey Yershov Date: Tue, 31 May 2016 17:39:22 +0300 Subject: [PATCH] Add iota to std --- generator/booking_quality_check/booking_quality_check.cpp | 4 ++-- std/numeric.hpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/generator/booking_quality_check/booking_quality_check.cpp b/generator/booking_quality_check/booking_quality_check.cpp index 57a46dad9c..bf0f71216e 100644 --- a/generator/booking_quality_check/booking_quality_check.cpp +++ b/generator/booking_quality_check/booking_quality_check.cpp @@ -5,6 +5,7 @@ #include "std/fstream.hpp" #include "std/iostream.hpp" +#include "std/numeric.hpp" #include "3party/gflags/src/gflags/gflags.h" @@ -54,8 +55,7 @@ int main(int argc, char * argv[]) LOG_SHORT(LINFO, ("Num of tourism elements:", elements.size())); vector elementIndexes(elements.size()); - for (size_t i = 0; i < elementIndexes.size(); ++i) - elementIndexes[i] = i; + iota(elementIndexes.begin(), elementIndexes.end(), 0); random_shuffle(elementIndexes.begin(), elementIndexes.end()); if (FLAGS_selection_size < elementIndexes.size()) diff --git a/std/numeric.hpp b/std/numeric.hpp index 8ef5ca86b6..9fed8f6d37 100644 --- a/std/numeric.hpp +++ b/std/numeric.hpp @@ -6,6 +6,7 @@ #include using std::accumulate; +using std::iota; #ifdef DEBUG_NEW #define new DEBUG_NEW