CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: rodis

Search: Search took 0.02 seconds.

  1. Replies
    16
    Views
    34,233

    Re: STL friendly operator

    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...
  2. Replies
    16
    Views
    34,233

    Re: STL friendly operator

    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...
  3. Replies
    16
    Views
    34,233

    Re: STL friendly operator

    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...
  4. Replies
    16
    Views
    34,233

    Re: STL friendly operator

    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...
  5. Replies
    16
    Views
    34,233

    STL friendly operator

    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...
Results 1 to 5 of 5





Click Here to Expand Forum to Full Width

Featured