Wakan Tanka Wakan Tanka - 4 years ago 208
C++ Question

C++ weird syntax spotted in Aruco codes

I have found strange syntax in some of Aruco files:

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

Seems like
is function, but if yes then what is
vector< cv::Mat >
in front of it? It is not declaration nor definition. Later it is used as array:

thres = thres_images[n_param1 / 2];

PS: full code can be found here

Answer Source

thres_images is a vector and its ctor is passed n_param1 as initial container size. This ctor is referred to as a fill ctor.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download