1
我使用boost::multi_index::multi_index_container<>
如何通过索引访问boost :: multi_index :: multi_index_container <>的所有元素?
以下是我的容器声明:
typedef boost::multi_index::multi_index_container<
myClssPtr,
boost::multi_index::indexed_by<
OrderdBValue // OrderdBValue this is boost::multi_index::ordered_unique type
>
>
我要访问此容器顺序的所有元素,我该怎么做?
你好@sehe,它导致到folllowing错误:错误:一个函数的定义在这里不允许使用前“:”令牌,如何“:”将努力为中循环? – balaji 2014-11-24 11:54:54
使用常规的,但与c + + 03语法:**更新**答案(当然,升级您的编译器,或通过'-std = c + + 11'!) – sehe 2014-11-24 11:59:29
请参阅[迭代器访问](http ://www.boost.org/doc/libs/1_57_0/libs/multi_index/doc/tutorial/basics.html#iterator_access)在文档 – sehe 2014-11-24 12:01:57