I used inline on some methods in my header file, will the be inline from that point or do I have to put inline in my .cpp file.
example:
class fff
{
inline int func();
}
int fff::func() // do I need inline here also?
{
}
I used inline on some methods in my header file, will the be inline from that point or do I have to put inline in my .cpp file.
example:
class fff
{
inline int func();
}
int fff::func() // do I need inline here also?
{
}
You dont need inline, but even if you add it, the compiler wont take it as wrong. Try it.
Inline just hints the compiler to replace the function call with the function code, instead of jumping to the function and returning from it. However, the compiler will ignore you if it is inefficient.