#include <iostream>
#include <string>

template<typename... Ts>
struct Executor { };

template<typename ReturnType, typename... Params>
struct Executor<ReturnType (*)(Params...)> {
    private:
//        using M = ReturnType (*)(Params...);
        typedef ReturnType (*M)(Params...);
    public:
        bool operator()(M method, Params... params) {
            ReturnType r = method(params...);
            
            return (r ? true : false);
        }
        
        template<typename... InvalidParams>
        bool operator()(M method, InvalidParams... ts) {
            return false;
        }
};

#define ExecuteMethod(M, ...) Executor<decltype(&M)>{}(M, ##__VA_ARGS__)



bool func(int i, int j, std::string& k) {
    k = "ho ho";
    return true;
}

int main() {
    int i = 3;
    int j = 4;
    std::string s = "yo";
    
    std::cout << s << std::endl;
    
    bool a = ExecuteMethod(func, i, j, s);
    bool b = ExecuteMethod(func, 3, 4, "yo");
    bool c = ExecuteMethod(func, "yo", 3, 4);
    
    std::cout << std::boolalpha << a << std::endl;
    std::cout << std::boolalpha << b << std::endl;
    std::cout << std::boolalpha << c << std::endl;
    std::cout << s << std::endl;
}