I tried to bind the static overloaded functions with pybind11, but got some problems.
Here is the sample code
#include <pybind11/pybind11.h>
namespace py = pybind11;
class TESTDB {
public:
static void aaaa(int a, int b) {printf("aaaaa");};
static void aaaa(int a) {printf("xxxxx");};
};
PYBIND11_MODULE(example, m) {
py::class_<TESTDB>(m, "db")
.def_static("aaaa", (void (TESTDB::*)(int, int)) &TESTDB::aaaa);
}
but it's failed to compile due to
error: no matches converting function ‘aaaa’ to type ‘void (class TESTDB::*)(int, int)’
.def_static("aaaa", (void (TESTDB::*)(int, int)) &TESTDB::aaaa);
note: candidates are: static void TESTDB::aaaa(int)
static void aaaa(int a) {printf("xxxxx");};
note: static void TESTDB::aaaa(int, int)
static void aaaa(int a, int b) {printf("aaaaa");};
any idea?
thank you