Article View: comp.std.c++
Article #2461Re: ??? static locals in inline functions ???
From: Fergus Henderson
Date: Tue, 07 Nov 1995 18:28
Date: Tue, 07 Nov 1995 18:28
24 lines
1447 bytes
1447 bytes
damian@molly.cs.monash.edu.au (Damian Conway) writes: >fjh@munta.cs.mu.OZ.AU (Fergus Henderson) writes: > >>The reason is that an inline function by default has static linkage, >>and so each translation unit gets its own copy. > >Is this the case for class function members >(which are automatically inlined)? No. Member functions of a class always have external linkage (unless the class is a local class declared inside a function). So there should always be only one occurrence of a static variable declared inside a class member function. -- Fergus Henderson WWW: http://www.cs.mu.oz.au/~fjh fjh@cs.mu.oz.au PGP: finger fjh@128.250.37.3 --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<9531123.18697@mulga.cs.mu.OZ.AU>Path:
arc1-ca.pugleaf.net!128.32.155.1!mattReferences:
<KAELIN.95Nov2201050@binki.bridge.com> <9530806.23850@mulga.cs.mu.OZ.AU> <damian.815685222@molly.cs.monash.edu.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson) Newsgroups: comp.std.c++ Subject: Re: ??? static locals in inline functions ??? Date: 07 Nov 1995 18:28:42 GMT Organization: Computer Science, University of Melbourne, Australia Approved: matt@physics2.Berkeley.EDU (Matt Austern) Message-ID: <9531123.18697@mulga.cs.mu.OZ.AU> References: <KAELIN.95Nov2201050@binki.bridge.com> <9530806.23850@mulga.cs.mu.OZ.AU> <damian.815685222@molly.cs.monash.edu.au> NNTP-Posting-Host: physics2.berkeley.edu