逆参照の結果ではなく、イテレータを直接渡す std::for_each のような関数はありますか?
私たちが持っているもの
std::vector<int> ints;
std::for_each(ints.begin(), ints.end(),
[](int i)
{
//how to get the iterator of this element???
}
私が探しているもの
for_each_iterator(ints.begin(), ints.end(),
[](const std::vector<int>::const_iterator &i)
{
//we know the iterator here
}
もちろん、そのような関数を書くのはかなり簡単ですが、 からの標準的な解決策が存在するかどうかを尋ねていstd::
ますstd::tr1::
。boost::