It is not necessay to write out a name of a passed variable in case of declaration:

For example its enough to write:

void myfunc(double,doble);

and not

void myfunc(double x, doble y);

But lets see a more difficult example:

template <class class_type> friend real myfunc(class_type& obj, double (class_type::*func)(double), const double&);

It is possible to eliminate the "func" which is just a name?

When we talk about the type variable then the answer is simple, the type specified in definition
Like “int iVar;” iVar is of type int.

But when we talk about the type function pointer then the type of function mean the whole name of function,
let’s take example
typedef BOOL (__stdcall *pFooo)(char *);
now you can define the variable of this function like this
pFooo MyFunction; //the type is pFoo
i.e. the pFoo is not just name it is type. In your case actually you are not specifying function pointer variable name, while you are specifying type only
use

typedef double (class_type::*func)(double);
Using Type only, as follows:
template <class class_type> friend real myfunc(class_type& obj, func, const double&);
Using Type variable as follows:
template <class class_type> friend real myfunc(class_type& obj, func MyFun, const double&);

Hope it’ll help you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.