There is a class A having all the declarations and definitions are placed inside as shown below:
class A
{
void f(); // forward declaration for a lengthy method
...
void g()
{
f(); // call the above forward-declared method
}
void f() // definition of a lengthy method
{
...
}
}
I don't want to take f() out of the class header like A::f(), but just want to keep all the source within the class. However, when I compile it, I get the following error:
error C2535: 'void A::f()': member function already defined or declared
note: see declaration of 'A::f'
Isn't there any way to resolve this issue?