Skip to content

Do not use = 0 for a cv::Mat.#20304

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
vrabaud:master
Jun 24, 2021
Merged

Do not use = 0 for a cv::Mat.#20304
opencv-pushbot merged 1 commit intoopencv:masterfrom
vrabaud:master

Conversation

@vrabaud
Copy link
Copy Markdown
Contributor

@vrabaud vrabaud commented Jun 23, 2021

There are several operator= overloads and some compilers can be confused.

This is not present in 3.4. I cannot get my compiler options but here is the error I get:

error: use of overloaded operator '=' is ambiguous (with operand types 'cv::Mat' and 'int')
meta = 0;
~ ^ ~
./include/opencv2/core/mat.hpp:1070:10: note: candidate function
Mat& operator = (const Mat& m);
^
./include/opencv2/core/mat.hpp:1257:10: note: candidate function
Mat& operator = (const Scalar& s);
^
./include/opencv2/core/mat.hpp:2099:10: note: candidate function
Mat& operator = (Mat&& m);

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work

There are several operator= overloads and some compilers can be confused.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants