Home > Back-end >  What does (1) mean when declaring a vector?
What does (1) mean when declaring a vector?

Time:04-22

What does the ...(1) do?

std::vector<std::vector<cv::Point>> tight_contour(1);

CodePudding user response:

tight_contour is a std::vector object containing elements of type std::vector<cv::Point>. The (1) is constructing tight_contour to hold 1 initial default-constructed element.

CodePudding user response:

That (1) is simply saying that tight_contour should be initialized with one element in it.

  • Related