--> Jerry Coffin wrote to Daniel Jones <--
JC>On (02 Aug 97) Daniel Jones wrote to Aare Tali...
JC>
JC> DJ> Please sketch me a class definition for an I/O stream which
JC> DJ> doesn't use references and allows this:
JC>
JC> DJ> cout << "I have " << Number << " apples.";
JC>
JC>I don't think this is the example you intended you use - if you try
JC>to do it, you'll find that while efficiency might be less than
JC>ideal (if `Number' is of some relatively large, complex type) but
JC>it's relatively easy and straightforward to code.
I missed the first part of this so maybe I am missing the point, but I
don't see how you can do this without a reference to the ostream. How
can you catenate << operators on a stream like this without returning
a reference to the ostream?
If it is easy, could you show an example? Off hand, I can't think of a
way to do it.
Cliff Rhodes
cliff.rhodes@juge.com
crhodes@flash.net
X CMPQwk 1.42 1692 X"Laws undertake to punish only overt acts." - Montesquieu
--- Maximus/2 3.01
---------------
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
|