
1 Sep
2011
1 Sep
'11
7:06 p.m.
On Wed, Aug 31, 2011 at 11:25 PM, Julien Nitard <julien.nitard@m4tp.org> wrote:
It can't, you will end up with a different function static variable for each translation unit.
This isn't the case. If you have an inline function with a static variable in it, it'll be the same variable in all translation units.
*7.1.2p4 A static local variable in an extern inline function always refers to the same object.*
... which I guess means you can still end up with several definitions when using dynamic libraries ?
Dynamic libraries are outside the scope of the C/C++ standard. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode