dizzy wrote:
>
> void func_real(type1 arg1, type2 arg2, char const* caller);
> #define func(arg1, arg2) func_real((arg1), (arg2), __FUNCTION__)
>
> __FUNCTION__ will be filled by the preprocessor with the
> current function name so you get that to your actual function.
>
> If someone has better options that still make it possible
> to use normal function call "func(arg1, arg2)" syntax
> without macros please advise...
And what will be?
***
typedef int type1;
typedef int type2;
//
typedef
void
(*t_func)
(type1 arg1, type2 arg2);
typedef
void
(*t_func_real)
(type1 arg1, type2 arg2, t_func func);
//
template<t_func_real Fn>
class Tcaller
{
public:
static
void
call(type1 arg1, type2 arg2)
{
Fn(arg1, arg2, call);
}
};
//usage
void func_real(type1 arg1, type2 arg2, t_func func);
void
foo(type1 arg1, type2 arg2)
{
Tcaller<func_real>::call(arg1,arg2);
}
***
Is it better? I am not sure.
Maksim A. Polyanin
old page about some C++ improvements:
http://grizlyk1.narod.ru/cpp_new