delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/03/17:37:14

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problem with fstreams...
Date: Wed, 03 Sep 1997 09:37:14 -0700
Organization: Alcyone Systems
Lines: 33
Message-ID: <340D923A.5D72DAB0@alcyone.com>
References: <Pine DOT SGI DOT 3 DOT 93 DOT 970829111108 DOT 28565A-100000 AT gibson> <5u62mh$9l6 AT freenet-news DOT carleton DOT ca> <34077a34 DOT 845806 AT snews DOT zippo DOT com> <5u8pmk$7j1 AT freenet-news DOT carleton DOT ca> <34087191 DOT 15417632 AT snews DOT zippo DOT com> <340B1EAB DOT 1F5BC046 AT alcyone DOT com> <5uisve$sfg AT freenet-news DOT carleton DOT ca>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Paul Derbyshire wrote:

> How do the enum elements BINARY and so forth become members of ios, as
> in
> ios::, and not of some enum? Normally the :: thing only applies to
> member
> functions and instance variables, not to enums. Is the enum actually
> inside the class? Can a class contain structs and subclasses actually
> inside itself so they are only defined in the scope of the class, for
> naming purposes?

Yes.  In C++ if you have full scoping, so lexical elements can be
defined inside classes:

    class C
    {
      public:
        struct S { int i; };

        enum E { e1, e2 };
    };

Inside the scope of the class, you can refer to these things as S and E,
but outside you must refer to them as C::S and C::E (and the enum names
as E::e1 and E::e2).

-- 
          Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
                        Alcyone Systems / http://www.alcyone.com/max/
   San Jose, California, United States / icbm://37.20.07n/121.53.38w
                                      \
                  "War is like love; / it always finds a way."
                                    / Bertolt Brecht

- Raw text -


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