Can I suppose that, from the call stack point view, it's the same to call a function like function1
int function1(T1 t1, T2 t2);
than to another like function2?
struct parameters_t
{
Wide<T1>::type t1;
Wide<T2>::type t2;
}
int function2(parameters_t p);
Where, Wide template wide T to the processor word length. For example, for 32-bit processors:
template<typename T, bool b = sizeof(T) >=4 >
struct Wide
{
typedef T type;
};
template<typename T>
struct Wide<T,false>
{
typedef unsigned int type;
};
I need to do something like this:
typedef int (*function_t)(parameters_t);
function_t function = (function_t) &function1;
parameters_t params;
// initialize params
function(params);
Thanks!