home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!destroyer!gatech!cc.gatech.edu!cc.gatech.edu!brianm
- From: brianm@cc.gatech.edu (Brian N. Miller)
- Subject: HELP: Trouble redefining <<
- Message-ID: <1992Nov17.162531.23815@cc.gatech.edu>
- Sender: news@cc.gatech.edu
- Organization: Georgia Tech College of Computing
- Date: Tue, 17 Nov 1992 16:25:31 GMT
- Lines: 15
-
- Hello, i'm working on a C++ PostScript generator.
-
- I want to redefine the << operator for a class derived from ostream such that
- it appends a ' ' after outputting any int.
-
- BROKEN CODE (Help me fix it...)
- -----------------------------------------
- class ps : private ostream {};
-
- ps &operator<< (ps &x, int i) { return (ps&) (ps ostream::<< i << ' '); }
- -----------------------------------------
-
- Needless to say, this code is not even parsable, but i'm sure you
- understand my intention. Any suggestions?
- Thanks in advance.
-