Thread View: comp.std.c++
1 messages
1 total messages
Started by Lewis.G..Pringle Lewis G. Pringl...
Mon, 12 Oct 1992 21:14
ios::iword, ios::pword, ios::xalloc
Author: Lewis.G..Pringle Lewis G. Pringl...
Date: Mon, 12 Oct 1992 21:14
Date: Mon, 12 Oct 1992 21:14
44 lines
2246 bytes
2246 bytes
Organization: Sophist Solutions In article <1992Oct8.234902.12170@lucid.com> jss@lucid.com (Jerry Schwarz) writes: >These functions are intended to support extension of stream types >without requiring derivation. My claim is that this is useful because >the actual type of a stream is lost in an expression involving insertions >or extractions. That is > > mystream m ; > m << y << mymanipulator ; > >You can't declare > > mystream& mymanipulator(mystream&) ; > >because it's argument is an ostream&, not a mystream&. However mymanipulator >can look into the infinite arrays for any useful information put there >by the mystream constructor. Could you please elaborate even further. A long standing problem with the isotream library, from my point of view, was that roughly half the time I wanted the interpretation of inserters to be that it inserted a "pretty" form of the item, and the other half of the time I wanted the interpretation to be to insert an EXTRACTABLE represenation of the item. This "pretty" form is most often useful when preparing to display some object, or when writting out debug info. The EXTRACTABLE version is most useful when saving and restoring to a file. I've experimented with hacks like global variables, etc, but what I really wanted was the ability to "add a boolean" into the iostream so that each inserter could write things out appropriately. Ideally I would want the predefiend inserters and extractors (eg int) to also pay attention to this boolean. Could the iword/pword mechanism be used to achieve this? Do you know of some better mechanism to achieve this? How are you supposed to actually use the iword/pword mechanism? Where is it documented? Lewis. -- Reading peoples signatures is a real waste of time. lewis@sophists.com (Lewis Gordon Pringle, Jr.)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads