inline friend functions.
I posted a question about this project (but a different topic altogether) a few days ago about overloading the * (dereferencing) operator. The question was answered, worked, but it brought up another question. I have function a. It is declared as a friend to class b. Function a needs to be an inline function. Would I write the function definition as:
- friend inline void function_a(int parameter);
If not, what do i need to rearrange?
You declare friend functions within class declarations. You don't specify inline functions within class declarations, they're automatically inline if you provide a body. If you're providing a seperate definition you don't have to specify the function is a friend because you will already have in the declaration.
Thanks. What's annoying though is that almost everytime I post a question, by the time i get a reply, I've figured it out myself... stupid Murphys Law..