STL 반복기를 다시 사용하려고 시도했지만 이에 대한 정보를 찾을 수 없습니다. 이 코드에있어 문제 :STL 반복자 재설정
std::vector< boost::shared_ptr<Connection> >::iterator poolbegin = pool.begin();
std::vector< boost::shared_ptr<Connection> >::iterator poolend = pool.end();
if(order) {
poolbegin = pool.rbegin(); // Here compilation fails
poolend = pool.rend();
}
for(std::vector< boost::shared_ptr<Connection> >::iterator it = poolbegin; it<poolend; it++) {
그러나 점점 오류 :
error: no match for ‘operator=’ in ‘poolbegin = std::vector<_Tp, _Alloc>::rbegin() with _Tp = boost::shared_ptr, _Alloc = std::allocator >’
새로운 값으로 반복자를 재설정 할 수있는 방법이 있습니까? shared_ptr :: reset처럼?
반복자를 반복자는 다른, 관련이없는 종류 역. –