Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!rice!cs.utexas.edu!asuvax!ncar!ames!pacbell!hoptoad!hsfmsh!dumbcat!marc From: marc@dumbcat.UUCP (Marco S Hyman) Newsgroups: comp.lang.c++ Subject: Re: implementation of static local variables Keywords: static local variable Message-ID: <142@dumbcat.UUCP> Date: 16 Mar 90 04:15:31 GMT References: <1350@otc.otca.oz> Organization: MH Software, Hayward, Ca. Lines: 17 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++. // marc -- // {ames,decwrl,sun}!pacbell!dumbcat!marc // pacbell!dumbcat!marc@lll-winken.llnl.gov