From 2812014eb5b0b4e62943d5177f07c73dce6a5f61 Mon Sep 17 00:00:00 2001 From: Davis King Date: Fri, 5 Feb 2016 12:50:02 -0500 Subject: [PATCH] Fixed compile time error. --- dlib/matlab/mex_wrapper.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlib/matlab/mex_wrapper.cpp b/dlib/matlab/mex_wrapper.cpp index 9c3e38679..655233ccd 100644 --- a/dlib/matlab/mex_wrapper.cpp +++ b/dlib/matlab/mex_wrapper.cpp @@ -515,6 +515,13 @@ namespace mex_binding img[r][c].blue = *data++; } +// ------------------------------------------------------- + + template + void call_private_set_mxArray(T&, mxArray*) {} + void call_private_set_mxArray(matrix_colmajor& item, mxArray* m) { item._private_set_mxArray(m); } + void call_private_set_mxArray(fmatrix_colmajor& item, mxArray* m) { item._private_set_mxArray(m); } + // ------------------------------------------------------- template @@ -578,7 +585,7 @@ namespace mex_binding throw invalid_args_exception(sout.str()); } if (is_column_major_matrix::value) - arg._private_set_mxArray((mxArray*)prhs); + call_private_set_mxArray(arg, (mxArray*)prhs); else assign_mat(arg_idx, arg , pointer_to_matrix(mxGetPr(prhs), nc, nr)); } @@ -592,7 +599,7 @@ namespace mex_binding } if (is_column_major_matrix::value) - arg._private_set_mxArray((mxArray*)prhs); + call_private_set_mxArray(arg,(mxArray*)prhs); else assign_mat(arg_idx, arg , pointer_to_matrix((const float*)mxGetData(prhs), nc, nr)); }