Closed straywriter closed 3 years ago
windows 10 vs 2019 I have the following code
#include <rttr/registration> using namespace rttr; #include <iostream> struct MyStruct { MyStruct() {}; void func() { std::cout << 0; } void func(double a) { std::cout << 1; }; int data; }; RTTR_REGISTRATION { registration::class_<MyStruct>("MyStruct") .property("data", &MyStruct::data) .method("func", static_cast <void(MyStruct::*)()>( &MyStruct::func)) .method("func", static_cast <void(MyStruct::*)(double)>( &MyStruct::func)); } #include <iostream> int main() { MyStruct obj; method meth = type::get(obj).get_method("func"); meth.invoke(obj); meth.invoke(obj,1.); }
meth.invoke(obj,1.); This code cannot be called How do I call an overloaded function
windows 10 vs 2019 I have the following code
meth.invoke(obj,1.); This code cannot be called How do I call an overloaded function