delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/23/11:15:15

From: D DOT J DOT Eleveld AT anest DOT azg DOT nl
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How can I tell if it's a bug from DJGPP or GCC?
Date: Wed, 23 Sep 1998 15:04:23 GMT
Organization: Deja News - The Leader in Internet Discussion
Lines: 48
Message-ID: <6ub2ln$j1r$1@nnrp1.dejanews.com>
References: <6u7smk$9t7$1 AT nnrp1 DOT dejanews DOT com> <36078819 DOT 377336654 AT news DOT snafu DOT de> <3607D133 DOT E01E67CD AT dds DOT nl> <36080bfd DOT 411106352 AT news DOT snafu DOT de>
NNTP-Posting-Host: 192.87.23.66
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <36080bfd DOT 411106352 AT news DOT snafu DOT de>,
  horst DOT kraemer AT snafu DOT de (Horst Kraemer) wrote:
> On Tue, 22 Sep 1998 18:32:51 +0200, DougEleveld <deleveld AT dds DOT nl>
> wrote:
> >> The scope of the declaration has nothing to do with scope of
> >> "destruction". The scope of "contruction" of singelton::instance is
> >> the scope of the class by definition. The scope of destruction is the
> >> scope of the definition - i.e. global scope. The d'tor is not
> >> accessible at global scope.
>
> >So you are saying that a static instance of a class does not have access
> >to it's own private constructors/destructors?
>
> Of course _it_ has not. Only member functions of the class have access
> to private member functions of the class.

So you are saying that static members are destructed at file scope and it is
totally irrelevant who thier friends are and the scope of the construction?
Consider the following quite similar code:

class singelton
{
 private:
   singelton() { };
   ~singelton() { };

 friend class wrapper;
};

class wrapper
{
 public:
   singelton nonstatic;
   static singelton isstatic;
};

singelton wrapper::isstatic;

The wrapper is allowed to have non-static singeltons, but not static
singeltons.  This implies that public/private and friends mean something
different for static or non-static members which (i think) is very strange.

Thanks,

Doug Eleveld

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019