What's wrong with this piece of code?

Discussion in 'C++' started by xz, Mar 13, 2008.

  1. xz

    xz Guest

    It's just a comman operator<<

    friend std::eek:stream& operator<<(std::eek:stream& os, const Vertex& v){
    return os << "(" << v.getX() << ", " << v.getY()<< ")";
    };

    The compiling error is:

    Vertex.h: In function 'std::eek:stream& operator<<(std::eek:stream&, const
    Vertex
    &)':
    Vertex.h:39: error: no match for 'operator<<' in 'os << "("'


    Am I missing some subtle mistake there?
     
    xz, Mar 13, 2008
    #1
    1. Advertising

  2. xz

    xz Guest

    Oh, I figured it out.....
     
    xz, Mar 13, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Przemo
    Replies:
    5
    Views:
    535
    Teemu Keiski
    Jul 18, 2004
  2. =?Utf-8?B?RGlmZmlkZW50?=

    Question on optimizing a piece of code

    =?Utf-8?B?RGlmZmlkZW50?=, Jun 9, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    399
    Patrice
    Jun 9, 2005
  3. Replies:
    3
    Views:
    637
  4. YYweii
    Replies:
    8
    Views:
    336
  5. Patrick Plattes

    Download a file piece by piece

    Patrick Plattes, Nov 30, 2006, in forum: Ruby
    Replies:
    2
    Views:
    215
    Patrick Plattes
    Nov 30, 2006
Loading...

Share This Page