🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.c++
Article #1877

Re: Probleme beim Vererben von fstream

#1877
From: Harald Fuchs
Date: Fri, 22 Mar 1996 17:53
20 lines
1495 bytes
Thomas Holubar <holubar@informatik.uni-frankfurt.de> writes:

> [deleted]

> Zunaechst: ein ueberladener stream-Operator _muss_ eine
> "friend-function" sein.

Nein.  Eine externe Funktion, die auf private Member zugreift, muß
eine Friend-Funktion sein.  Das ist für einen Stream-Operator aber
nicht unbedingt der Fall:

  ostream& operator<< (ostream& s, const complex& x) {
    return s << x.re() << "+" << x.im() << 'i';
  }

muß kein Friend sein, da re() und im() wohl ohnehin public sind.

> "Win95: from the people who brought you 'edlin' !" (seen on USENET)

Ist "edlin" wirklich so furchtbar, wie alle behaupten? :-)
Technical Details
Message-ID: <pud965qak1.fsf@themroc.colibri.de>
Path: arc1-ca.pugleaf.net!rz.uni-karlsruhe.de!not-for-mail
References: <31486437.41C6@studi.epfl.ch> <4isqrl$s7h@zeus.rbi.informatik.uni-frankfurt.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!rz.uni-karlsruhe.de!not-for-mail
From: hf@colibri.de (Harald Fuchs)
Newsgroups: de.comp.lang.c++
Subject: Re: Probleme beim Vererben von fstream
Date: 22 Mar 1996 18:53:18 +0100
Organization: Colibri GmbH, Germany
Sender: hf@themroc.colibri.de
Message-ID: <pud965qak1.fsf@themroc.colibri.de>
References: <31486437.41C6@studi.epfl.ch>
 <4isqrl$s7h@zeus.rbi.informatik.uni-frankfurt.de>
NNTP-Posting-Host: teco01a.teco.uni-karlsruhe.de
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
In-reply-to: Thomas Holubar's message of 22 Mar 1996 00:05:09 GMT
X-WWW-Home-Page: http://www.colibri.de/~hf/
X-PGP-Public-Key: finger hf@colibri.de
X-PGP-Fingerprint: 09 4E C4 A2 B2 C5 33 1A  79 80 5D 39 BD 9B 89 39
X-Disclaimer: Kore wa Colibri no iken dewa arimasen
X-Newsreader: Gnus v5.1