O'Reilly logo

Efficient C++ Performance Programming Techniques by David Mayhew, Dov Bulka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inlining with Static Local Variables

Local static variables can be very problematic for compiler-based inline resolution. Some compilers will refuse to inline any method that contains a static variable declaration. Some compilers will allow statics to be inlined, but then incorrectly create multiple instances of the inlined variable at run-time. There probably are, no doubt, even some compilers that provide the worst of both worlds: they do not inline methods with static variables, but they do create an independent instance of the method within each separately compiled module. Certainly some of this difficulty is the result of a change in the way C++ handles inlined methods. The current language specification requires external linkage of inlined ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required