If you use Qt and endl, you could accidentally use the wrong
endl, happened to me today and i was like ..WTF ??
//notice that i dont have a "using namespace std;"
int main(int argc, char** argv)
std::cout << "Finished Execution !" << endl << "...";
// Line above printed: "Finished Execution !67006AB4..."
Of course that was my mistake, since i should have written
std::endl, but if you use
endl, qt and
using namespace std; it depends on the order of the include files if the correct
endl will be used.*
Of course you could recompile Qt to use a namespace, so you get a compilation error for the example above.
EDIT: Forgot to mention, Qt's
endl is declared in "qtextstream.h" which is part of QtCore
*EDIT2: C++ will pick the correct
endl if you have a
std::cout or the namespace
std::endl is in the same namespace as
std::cout, C++'s ADL mechanism will pick