在 Aruco 代码中发现 C++ 奇怪的语法

C++ weird syntax spotted in Aruco codes

我在一些 Aruco 文件中发现了奇怪的语法:

vector< cv::Mat > thres_images(n_param1);

貌似thres_images是函数,如果是那么它前面的vector< cv::Mat >是什么?它不是声明也不是定义。后来它被用作数组:

thres = thres_images[n_param1 / 2];

PS: 完整代码可以找到here

thres_images 是一个向量,它的构造函数被传递 n_param1 作为初始容器大小。该构造函数称为填充构造函数。