64,281
社区成员
发帖
与我相关
我的任务
分享
for(auto m:msconf)
_map_mm.insert(make_pair(m.id,m));”
//get image limits
cv::Point pmin(std::numeric_limits<int>::max(),std::numeric_limits<int>::max()),pmax(std::numeric_limits<int>::lowest(),std::numeric_limits<int>::lowest());
for(auto b:*this){
for(auto p:b){
pmin.x=min(int(p.x),pmin.x);
pmin.y=min(int(p.y),pmin.y);
pmax.x=max(int(p.x+0.5),pmax.x);
pmax.y=max(int(p.y+0.5),pmax.y);
assert(p.z==0);
}
}
#include <iostream>
#include <vector>
int main() {
std::vector<int> v = {0, 1, 2, 3, 4, 5};
for (const int& i : v) // access by const reference
std::cout << i << ' ';
std::cout << '\n';
for (auto i : v) // access by value, the type of i is int
std::cout << i << ' ';
std::cout << '\n';
for (auto&& i : v) // access by reference, the type of i is int&
std::cout << i << ' ';
std::cout << '\n';
for (int n : {0, 1, 2, 3, 4, 5}) // the initializer may be a braced-init-list
std::cout << n << ' ';
std::cout << '\n';
int a[] = {0, 1, 2, 3, 4, 5};
for (int n : a) // the initializer may be an array
std::cout << n << ' ';
std::cout << '\n';
for (int n : a)
std::cout << 1 << ' '; // the loop variable need not be used
std::cout << '\n';
}