Starting from Visual 2003, some libraries for iostream have been removed and e.g. the class 'ostream_withassign' is no longer available.
So now I cannot do something like the following:
ostream_withassign list;
if(to_screen)
list = cout;
else
list = something_else;
Any solution

i/o streams
abonefas22
I'd never heard of this, but a quick google tells me it was part of iostream.h ( which is why I've never heard of it ). iostream.h was before the C++ standard, and VS2005 finally does not offer it, offering only standard C++, in the form of iostream ( without the h ). streams with operator = are not part of the c++ standard, and are no longer supported for that reason. I guess the solution is to rethink your code.
EvilPenguin
I use the following:
ostream list;
if(to_screen)
list.rdbuf(&cout);
else
list.rdbuf(&something_else);
alexis.sourceau
Thank you!
I knew all that ... but rethinking my (existing) code was exactly what I would like to avoid or at least minimize.
Yael Rootberg
Very good!
Another option is:
ofstream list;
if(to_screen)
else
But of course you lose flexibility.
KienLip
OK, well I guess it does not help now, but when I moved from VC6 to VC7, I only had to change one line of code, and I knew that it was non-standard when I wrote it. I've not had any problems moving to VC 7.1 and VC8. In other words, if you know what the standard is, and code to it, then future changes to make the compiler more standards compliant won't affect you. I've never written code that uses iostream.h, and always corrected people who I see using it in forums.