Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1281 "No matching function for overload" with C++ default argumen

open
octave (7)
5
2012-12-21
2012-11-12
Anonymous
No

It compiles fine but at run-time octave gives me this "error: No matching function for overload".

This is the function:

extern void placet_get_transfer_matrix_element_fit(MatrixNd &out_elements,
const std::string &in_beamline,
const std::string &in_beam,
const std::string &in_survey,
const std::vector<std::string> &in_elements,
int in_start = 0,
int in_end = -1);

NOTICE THAT:

If I remove the default value from the two last arguments it works fine.

const std::vector<std::string> & is a typemap. If I replace it with const std::string & (default implementation via std_string.i) it works again.

I came to conclude that the error happens in

SWIGRUNTIME int SWIG_Octave_ConvertPtrAndOwn(octave_value ov, void **ptr, swig_type_info *type, int flags, int *own) :

this check fails :

if (ov.type_id() != octave_swig_ref::static_type_id())
// return SWIG_ERROR;

SWIG 2.0.8 on Mac with macports.

Discussion