Boost 中定义了很多"范围",很多标准库函数都使⽤了范围风格的实现。这⼀概念被C++11提了出来:
int arr[5]; std::vector<int> v; for(int x: arr); for(const int& x: arr); for(int x: v); for(auto &x: v);
Last updated 2 years ago