Posted: Thu Nov 27, 2008 1:00 pm Post subject: checking if object is member of
Hi to all. I have a function that takes an ostream object as an argument. I want to be able to pass to it either cout or a file stream. Is there any way I can distinguish between the two. For example:
code:
ostream &out
if(out is a member of ofstream)
//do file stuff
else
//do terminal stuff
Sponsor Sponsor
md
Posted: Thu Nov 27, 2008 5:10 pm Post subject: RE:checking if object is member of
Passing an additional flag is probably the easiest way, otherwise...