c++哪些容器支持随机迭代器
时间: 2024-01-05 17:37:51 浏览: 123
在C++标准库中,支持随机迭代器的容器有array和vector。\[1\]\[2\]这两个容器都提供了random_access_iterator,可以通过直接偏移量访问元素,比如使用it+5即可访问迭代器it后面的第五个元素。
#### 引用[.reference_title]
- *1* *3* [C++:迭代器和容器](https://blog.csdn.net/m0_69414302/article/details/125740393)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [C++ STL各容器迭代器种类及使用原因总结](https://blog.csdn.net/qq_26735913/article/details/111301047)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文