Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!cimshop!davidm From: cimshop!davidm@uunet.UU.NET (David S. Masterson) Newsgroups: comp.lang.c++ Subject: Re: implementation of static local variables Message-ID: Date: 19 Mar 90 05:30:58 GMT References: <1350@otc.otca.oz> <142@dumbcat.UUCP> Sender: davidm@cimshop.UUCP Organization: Consilium Inc., Mountain View, California. Lines: 25 In-reply-to: marc@dumbcat.UUCP's message of 16 Mar 90 04:15:31 GMT In article <142@dumbcat.UUCP> marc@dumbcat.UUCP (Marco S Hyman) writes: In article <1350@otc.otca.oz> ruben@otc.otca.oz (Ruben Gonzalez) writes: Why should I have to make a variable visible to an entire object when it is only used by one member function? Call it the pragmatics of implementation. If the variable is to be kept on a per instance basis then it must be kept in the struct that defines the class. Since the size of the struct must be known by all files that use the struct all elements of the structure must be defined in the header file. About the only way around this is some kind of pre-compiled class with other classes reading some kind of class description file instead of the header. But that's not C++. I think I missed something in this discussion (like the whole original message), but, given the question above, isn't this the meaning of a "static" local variable (a variable declared within the scope of only the member function with a "static" storage class)? That's the straight C definition?!? -- =================================================================== David Masterson Consilium, Inc. uunet!cimshop!davidm Mt. View, CA 94043 =================================================================== "If someone thinks they know what I said, then I didn't say it!"