🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1990

Re: GNU C++ 1.35.0 fixes

#1990
From: Doug Schmidt
Date: Fri, 12 May 1989 18:47
50 lines
2332 bytes
In article <8905111754.AA03931@yahi.stanford.edu> tiemann@lurch.stanford.edu writes:
++ I put a new g++.xtar.Z on yahi:~ftp/pub.  You can also get the file
++ `patches', which takes the g++.xtar.Z from last week and makes it
++ current.  libg++ and GNU C++ are still converging, but if you want
++ bugfixes, they're here.  Hope to make an "official" release soon,

When the official release comes out be sure to check out the new
support for static member functions.  It is now possible to use C++
classes in a pseudo Ada/Modula 2 fashion.  For example:

----------------------------------------
class stack
{
private:
  static int  st[10];
  static int  top;
     
public:
  static void push (int item) { st[top++] = item; }
  static int pop () { return st[--top]; }
  static int is_empty () { return top == 0; }
  static int is_full () { return top >= 10; }
};

main ()
{
  for (srandom (time ()); !stack::is_full (); stack::push (random ()))
    ;

  while (!stack::is_empty ())
    printf ("%d\n", stack::pop ());
}
----------------------------------------

now works as expected.  This means that you don't always need to
declare objects of a class in order to get the benefits of
encapsulation.  I also assume that function calls for static member
function are slightly faster, since there is no need to pass ``this''
as a hidden parameter.

Also, multiple inheritance support in g++ is getting more robust.
Aggressive g++ users are encouraged to pound on this feature and
report any bugs you find.

Doug
--
On a clear day, under blue skies, there is no need to seek.
And asking about Buddha                +------------------------+
Is like proclaiming innocence,         | schmidt@ics.uci.edu    |
With loot in your pocket.              | office: (714) 856-4043 |
Technical Details
Message-ID: <14181@paris.ics.uci.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!bu-cs!purdue!ames!elroy!ucla-cs!uci-ics!glacier.ics.uci.edu!schmidt
References: <8905111754.AA03931@yahi.stanford.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!bu-cs!purdue!ames!elroy!ucla-cs!uci-ics!glacier.ics.uci.edu!schmidt
From: schmidt@glacier.ics.uci.edu (Doug Schmidt)
Newsgroups: gnu.g++.bug
Subject: Re: GNU C++ 1.35.0 fixes
Message-ID: <14181@paris.ics.uci.edu>
Date: 12 May 89 18:47:21 GMT
References: <8905111754.AA03931@yahi.stanford.edu>
Sender: news@paris.ics.uci.edu
Reply-To: Doug Schmidt <schmidt@glacier.ics.uci.edu>
Distribution: gnu
Organization: University of California at Irvine: ICS Dept.
Lines: 50