[EMAIL PROTECTED] wrote: > Thanks for this. I'm beginning to understand a bit more. Just to > clarify (if you will), I notice that the original program that raised > this issue had an #include <iostream> at the top because the student > was using cout.
Please also tell your students that including <iostream> is not enough to use std::cout, it is only guaranteed to be declared. If you want to output something, you also need <ostream>. Most standardlibraries indirectly include <ostream> into <iostream> though, so it works most of the time. > If I remove that line, then the swap function becomes > unrecognized. So for some reason, iostream is prototyping swap either > directly or indirectly. Right, but just as with above iostream/ostream, this is not something you should rely on. Only by including <algorithm> you are guaranteed to get std::swap(). Uli -- http://gcc.gnu.org/faq.html http://parashift.com/c++-faq-lite/ _______________________________________________ Help-gplusplus mailing list Help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus