CppExperiments/DynamicMethods/main.cpp

19 lines
464 B
C++
Raw Normal View History

2021-10-21 13:00:01 +00:00
#include <iostream>
#include <cstdint>
#include "dynamicMethods.h"
using namespace std;
void* hello (dynamicMethods *thisPtr, std::vector<std::string> param) {
std::cout << "hello " << thisPtr << endl;
std::cout << "hello " << param[0] << endl;
return (void*)100;
}
int main() {
dynamicMethods test;
test.addMethod("hello", hello);
auto res = test.callMethod<intptr_t>("hello", {"ciao"});
cout << "Ritorno: " << res << endl;
}