const_iterator cbegin() const noexcept;
// multimap::cbegin/cend #include <iostream> #include <map> int main () { std::multimap<char,int> mymultimap = { {'x',100}, {'y',200}, {'x',300} }; // print content: std::cout << "mymultimap contains:"; for (auto it = mymultimap.cbegin(); it != mymultimap.cend(); ++it) std::cout << " [" << it->first << ':' << it->second << ']'; std::cout << '\n'; return 0; } |
multimap::begin | 返回指向multimap容器第一个元素的迭代器(公众成员函数) |
multimap::cend | 返回一个指向容器末尾元素的下一个元素的常量迭代器(公众成员函数) |
multimap::crbegin | 返回指向容器中最后一个元素的常量反向迭代器(公众成员函数) |