This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Global static variables
- To: Soeren Grimm <soeren at viatronix dot net>
- Subject: Re: Global static variables
- From: Michael Eager <eager at mvista dot com>
- Date: Mon, 21 May 2001 19:22:57 -0700
- CC: gcc mailinglist <gcc at gcc dot gnu dot org>
- Organization: MontaVista Software, Inc.
- References: <3B0537A5.BAE3F351@viatronix.net>
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