mayer@rochester.ARPA (04/25/86)
From: Jim Mayer <mayer>
There is a minor problem in the definition of the "stream" package, as
defined in the book and in the 1.0 release. Quoting from the book:
class ostream {
// ...
public:
ostream& operator<<(char *);
...
};
This should really be:
class ostream {
// ...
public:
ostream& operator<<(const char *);
...
};
The way it stands, I have to use "form" to get around the type checking,
or coerce any constant character pointer arguments to (char *) before
printing them. The change is upwards compatible with what is currently
defined (I've tried it).
Unfortunately, it doesn't seem possible to get around the problem with
overloading either.
-- Jim Mayer University of Rochester
(arpa) mayer@Rochester.ARPA Department of Computer Science
(uucp) rochester!mayer Ray P. Hylan Building
(via allegra, decvax, or seismo) Rochester, New York 14627bs@alice (04/27/86)
> From: Jim Mayer <mayer> > Path: ..!rochester!mayer > > There is a minor problem in the definition of the "stream" package, as > defined in the book and in the 1.0 release: > > ostream& operator<<(char *); > > This should really be: > > ostream& operator<<(const char *); Yes, that is what we are doing here now. In general, ``const'' was not used systematically enough in release 1.0.