I have some functors that I want to make member variables of a class, which I declare in my header file like so
class A {
public:
//...
typedef struct functor1 functor1;
//...
}
I then want to define these functors in my source file (purely for organisational reasons), something like
A::functor1 {
void operator()(int in) const {
//stuff
}
};
However this gives me an 'unqualified-id before ‘{’ token' error. Can anyone show me how to achieve what I'm aiming for or something similar?