February 20th, 2012, 02:38 PM
Thanks for the support!
(However I have to disagree with monarch_dodra complaints: 1) if I wanted a different seperating sequence, I'd use a "named"' function (or try to write a iomanip-like...
February 13th, 2012, 04:05 PM
OK, this is peculiar, but
ostream& operator << (ostream& strm, const char* s)
{
static string tmpstr;
tmpstr = s;
strm << tmpstr;
return strm;
}
solves the problem, so iostream...
February 13th, 2012, 02:48 PM
stl_test.cpp: In function ‘std::ostream& operator<<(std::ostream&, T)’:
stl_test.cpp:19: error: call of overloaded ‘operator<<(std::basic_ostream<char, std::char_traits<char> >&, const...
February 13th, 2012, 02:27 PM
OK, why class in class T::iterator should be changed to typename? It works both ways I guess (just as one can write
template <typename T>.
I forgot to copy "using namespace std;" (it's a small...
February 13th, 2012, 12:41 PM
I want to overload ostream& operator << so that it prints content of whatever container I want. I wrote something like this:
#include <iostream>
#include <list>
#include <set>
template <class...