C++中向量的大小

Haz*_*lah -7 c++ opencv

如何在c ++中获取向量中元素的计数

cv::vector<cv::vector<cv::Point>> temp;
Run Code Online (Sandbox Code Playgroud)

我试试这个,但它没有给出真正的尺寸?

int counts=Sizeof(temp);
Run Code Online (Sandbox Code Playgroud)

我也尝试过这个

int counts=[temp count];
Run Code Online (Sandbox Code Playgroud)

Vin*_*ale 5

使用temp.size()用于查找的大小 Vector.