jaeandersson / swig

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.
http://www.swig.org
Other
23 stars 19 forks source link

Static function in C++, non-static method in MATLAB #14

Closed jaeandersson closed 9 years ago

jaeandersson commented 9 years ago

MATLAB functions work differently from member functions in C++. In particular, there is no requirement that the first argument needs to be "self/this". The closest C++ correspondence to such a non-static method in MATLAB is a static function. It therefore makes sense to add a %feature marker to static C++ functions allowing them to be mapped to non-static methods in the MATLAB proxy.