【发布时间】:2015-05-12 20:39:07
【问题描述】:
在没有 boost::counting_iterator 的情况下插入一系列连续整数的最佳方法是什么。[c++]
// Insert 1 to 9
set<long> set1.insert(boost::counting_iterator<int>(1)
,boost::counting_iterator<int>(10))
【问题讨论】:
-
您的代码有效。你还想要什么?除此之外,您可以循环并插入。
-
它可以工作,但我想不使用 boost 库。
标签: c++ iterator containers std