Creating a Foo object passing func to constructor works just fine in this example:
int func(int a) { return a; }
struct Foo {
Foo( int (*func_ptr)(int) ) {};
};
Foo bar(func);
However attempting to create a Foo object inside another class does not:
class ThisIsCrap {
Foo doesntWork(func);
};
How can I create a Foo object inside a class like I can outside a class? On the bit that doesn't compile, the error is: "cannot resolve type 'func'"
Thanks in advance.