home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!uunet.ca!frumious!pat
- From: pat@frumious.uucp (Patrick Smith)
- Subject: Re: Just what is so great about streams?
- Message-ID: <1992Nov14.014733.534@frumious.uucp>
- Date: Sat, 14 Nov 1992 01:47:33 GMT
- Reply-To: uunet.ca!frumious!pat
- References: <1992Nov12.061942.16473@nuscc.nus.sg> <KANZE.92Nov13200446@slsvhat.us-es.sel.de>
- Organization: None
- Lines: 20
-
- kanze@us-es.sel.de (James Kanze) writes:
- |Does anyone know of a better way of handling IO formatting in a
- |type-safe, extensible manner. It's too late to change the iostream
- |syntax, but I am curious as to what the alternatives are.
-
- I've always thought it would be nice to be able to write
- something like
-
- int i = 20, j = 17;
- cout["i = %d, j = %d\n"] << i << j;
-
- This wouldn't involve any loss of type safety, since a separate
- routine would be invoked for each type of value to be printed.
- With some work, it could probably also be set up so that it
- could be extended to printing user-defined types.
-
- --
- Patrick Smith
- uunet.ca!frumious!pat
- pat%frumious.uucp@uunet.ca
-