使用指针的std :: iterator

时间:2016-06-16 03:58:45

标签: c++ pointers c++11 vector

我有一个大的向量,我使用指向该指针的小部分的指针将其分成更小的部分。现在,我想使用std :: iterator遍历由大向量指针标记的部分。

imgVec is that large vector

// dividing the imgVec into pieces of size queue_len
for (int i=0; i<imgVec.size(); i += queue_len) {
                    buff = &imgVec[i];
                    imgPtr.push_back (buff);
}

最初迭代器代码是这样的:

for (folly::fbvector<InputImage>::iterator it = imgVec.begin(); \
                        it != imgVec.end() ; ++it) {
    folly::via (&cpuThreadPoolExecutor, \
        std::bind(vcu::follyPerformDetection, *it.base(), detectConfig));
}

现在,我需要迭代器开始时指向开头的imgPtr[0]指针和指向队列部分末尾的imgPtr[1]。我如何将它放入迭代器?

0 个答案:

没有答案
相关问题