Reputation: 4320
I'm very new to C++ and I am creating my first class. I have every error out of the way except one:
error: expected unqualified-id before & token
The assignment operator signature looks like this:
Job::& operator = (const Job &v )
I've tried everything I can think of, removing the &, doing Job::Job & operator, removing the Job. Nothing works.
I know it's simple, I just don't know what it is.
Upvotes: 3
Views: 12883
Reputation: 9687
When declaring inside the class definition:
Job& operator = (const Job &v )
When defining outside the class definition:
Job& Job::operator = (const Job &v )
Upvotes: 9