This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Global static variables


Soeren Grimm wrote:
> 
> Hi,
> 
> i don't know where i exactly should ask this. By i think may be this is
> the
> right mailinglist.

See Comp.lang.c++

> We have a huge project with different modules. So we wanna make our own
> output-stream.
> Like std::out, but with special features. But for this we must somehow
> ensure that there is only ONE instance of the outputstream in the whole
> project.

Look for the singleton pattern.  Every implemention of iostreams does this.

--
Michael Eager     eager@mvista.com	408-328-8426	
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA  94085


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]