Thread View: comp.std.c++
1 messages
1 total messages
Started by Martin Prange
Mon, 09 Oct 1995 15:46
operator(s) << are member functions. Why?
Author: Martin Prange
Date: Mon, 09 Oct 1995 15:46
Date: Mon, 09 Oct 1995 15:46
20 lines
1462 bytes
1462 bytes
To make the operator(s) << (from iostream.h) usable by other classes, they must be derived by the appropriate iostream-class. As non-member functions they could be used by any class, that could be casted to (ostream&) by means of e.g. operator ostream&. ( Which is, what I actually wanted to. ) So, the question is: Why are these operators declared (and implemented , of course), as members ? Are there design issues I`ve been missing so far? -- Martin Prange / Member of ALMAP Team / ALCATEL +49 030 3120 just alcanet: prange@sel.bln.alcatel.de else @cs.tu-berlin.de If you believe, the opinions expressed here are mine - you got it [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
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