🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2445

Re: ??? static locals in inline functions ???

#2445
From: Damian Conway
Date: Tue, 07 Nov 1995 04:42
20 lines
1383 bytes
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)?

>To get the behaviour exhibited by MSVC++ from a draft
>standard-conforming compiler, you would have to explicitly declare foo() as
>`extern'.

If the answer to the previous question is "yes",
does this also work for class function members?

damian
---
[ 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: <damian.815685222@molly.cs.monash.edu.au>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
References: <KAELIN.95Nov2201050@binki.bridge.com> <9530806.23850@mulga.cs.mu.OZ.AU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
Date: 07 Nov 95 04:42:13 GMT
Approved: fjh@cs.mu.oz.au
Return-Path: <daemon@migs.UCAR.EDU>
X-Original-Date: Mon, 06 Nov 1995 19:13:42 +0000 (GMT)
From: damian@molly.cs.monash.edu.au (Damian Conway)
Subject: Re: ??? static locals in inline functions ???
Message-ID: <damian.815685222@molly.cs.monash.edu.au>
Organization: Monash University
Newsgroups: comp.std.c++
References: <KAELIN.95Nov2201050@binki.bridge.com>
 <9530806.23850@mulga.cs.mu.OZ.AU>
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMJ7jtOEDnX0m9pzZAQFQ9gGAn32WlPOzE5qKMy1rpPQWrps4PC0/k/Q1
 hHq32ruHi3/dbWi+TTiuYhoTu29/yLky
 =gAzt