Boost logo

Boost :

Subject: Re: [boost] [any] new version
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2011-09-01 15:06:29


On Wed, Aug 31, 2011 at 11:25 PM, Julien Nitard <julien.nitard_at_[hidden]> 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk