In my header file I declare structure
typedef struct _PreprocessedImage
{
cv::Rect straight;
cv::Rect diagonal;
bool empty = true;
...
...
} PreprocessedImage;
Then I create class with method
std::vector<float> processData(cv::Mat &image, bool drawRegions = false, PreprocessedImage &preproc);
.
Try to compile and got
"error: default argument missing for parameter 3"
But when I try to declare method with default value, like that:
std::vector<float> processData(cv::Mat &image, bool drawRegions = false, PreprocessedImage &preproc = PreprocessedImage());
.
I got
"error: invalid initialization of non-const reference of type 'PreprocessedImage& {aka _PreprocessedImage&}' from an rvalue of type 'PreprocessedImage {aka _PreprocessedImage}'"
How can i fix it?