我有一個私有成員std::set<Segment*> mSegments
類和下面的方法:無效初始化錯誤
std::pair<iterator, iterator> getSegments() {
return boost::tie(mSegments.begin(), mSegments.end());
}
,我得到以下錯誤:
invalid initialization of non-const reference of type
std::_Rb_tree_const_iterator<Segment*>&
from a temporary of typestd::_Rb_tree_const_iterator<Segment*>
我不知道如何解決這個問題一。誰能告訴我問題是什麼?