I'm working with v8 engine : so javascript call c++ function, I'm trying to found a way to template with c++11, instead of manually do the job.
The return type can be void, string, boolean, float.
The argument function is always : const v8::FunctionCallbackInfo<v8::Value> & args
For the begining i try a function with a void return.
// Javascript function.
print ( "Hello );
// C++ javascript engine function call from java script.
void Print_java ( const v8::FunctionCallbackInfo<v8::Value> & args ){...}
// C++ function that need to be call from Print_cpp
void Print_cpp ( const std::string & szValue ){...}
Pseudo code.
Convert args [0] to std::string
call Print_cpp
I explore variadic template, parameter pack, functor, lambda, tuple, but i don't found how assemble it to do the job...
Thanks for your help...