Can getters and setters be inlined when definition and declaration are seperated in .h and .cpp files?

Posted by Nathan on Stack Overflow See other posts from Stack Overflow or by Nathan
Published on 2011-03-08T16:02:37Z Indexed on 2011/03/08 16:10 UTC
Read the original article Hit count: 242

Filed under:
|
|

I have searched and have been unable to verify how the GCC compiler will handle inlining getters and setters when declaration is in .h file and definition is in .cpp file.

Most seem to say that GCC can't see across these source file barriers and won't be able to inline these at all, while others disagree. I have looked at the documentation and I can't find the answer there either. Did I miss it?

I do realize that inlining is a choice made by the compiler and is not always guaranteed, but assuming optimal situations, is it at least possible?

© Stack Overflow or respective owner

Related posts about c++

Related posts about gcc