Из мира Python
я считаю, что функция std::iota
очень ограничена. Почему интерфейс ограничен, чтобы не принимать никаких UnaryFunction
?
Например, я могу преобразовать
>>> x = range(0, 10)
в
std::vector<int> x(10);
std::iota(std::begin(x), std::end(x), 0);
Но как это сделать:
>>> x = range(0,20,2)
или даже
>>> x = range(10,0,-1)
Я знаю, что это тривиально написать одну из таких функций или использовать Boost, но я подумал, что комитет С++ должен тщательно подобрать этот дизайн. Так ясно, что я пропускаю что-то из С++ 11.