Matlab bindings: fixed the functional template to perform an explicit cast to the...
authorRok Mandeljc <rok.mandeljc@gmail.com>
Mon, 28 Apr 2014 13:43:12 +0000 (15:43 +0200)
committerRok Mandeljc <rok.mandeljc@gmail.com>
Sat, 3 May 2014 15:37:48 +0000 (17:37 +0200)
commitfa075c50a1863bba8f99a64f816e11a155f93165
treeb56e85d97214a3d51b6c60d7fc51548907066ae8
parent2d47dd7038c5db7412b1e0e562cb2987ffb601f9
Matlab bindings: fixed the functional template to perform an explicit cast to the type of an input option that is expected. This avoids issues with ternary operator not having the same type in rvalue and lvalue, such as in the case below:

Ptr_FeatureDetector blobDetector = inputs[3].empty() ? makePtr<SimpleBlobDetector>() : inputs[3].toPtrFeatureDetector();

Which after the patch, would be:

Ptr_FeatureDetector blobDetector = inputs[3].empty() ? (Ptr_FeatureDetector) makePtr<SimpleBlobDetector>() : inputs[3].toPtrFeatureDetector();
modules/matlab/generator/templates/functional.cpp