home *** CD-ROM | disk | FTP | other *** search
- //----- Anfang BUG1.CPP ------------------------------------
- // (c) 1990 by Thole Groeneveld & toolbox
-
- #include <iostream.h>
- #include <iomanip.h>
-
- // Fehler tritt nur auf bei C++ - Compileroption :
- //
- // [ ] Out-of-line Inline Function
- //
- // Außerdem muß in die Ausgabekette eine Funktion
- // eingehängt werden für deren Rückgabetyp
- // die Ausgabeoperatorfunktion als inline definiert
- // worden ist, wie z.B. bei setw(int) mit Rückgabewert
- // smanip_int aus iomanip.h
- // Die Verwendung von generic.h in iomanip.h ist von
- // keinerlei Bedeutung für das Auftreten des Fehlers
-
- class B { // entspricht class Time aus timeclss.h
- public:
- friend ostream& operator << (ostream&, const B&);
- private:
- int y;
- };
-
- ostream& operator << (ostream& os, const B& b) {
- os << setw(2) << b.y;
- // Fehlermeldung :
- // B::y is not accessible in function operator << ...
- return os;
- // Warnung :
- // Parameter 'b' is never used in function ...
- }
- //----- Ende BUG1.CPP --------------------------------------