Thread: Overloading

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Psst Prelude the function should be:
    Code:
    ostream& operator<< ( ostream& out, const String& s )
    {
      s.print ( out );
      return out;
    }
    since its a friend function and not a member function.

    And your right there is no way to argue with fraught

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >Psst Prelude the function should be
    Shh! If you don't say anything then maybe nobody will notice.

    >And your right there is no way to argue with fraught
    My code is fraught with perfection. If it looks wrong then that's only because, in my awesomeness, I anticipated a future addition to the language and started using it. Yea, that's it. I'm so awesome that I can predict the tides of ISO! Hahaha! Make way for my head!
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Overloading operators
    By ugmusicbiz in forum C++ Programming
    Replies: 2
    Last Post: 02-13-2009, 01:41 PM
  2. unary operator overloading and classes
    By coletek in forum C++ Programming
    Replies: 9
    Last Post: 01-10-2009, 02:14 AM
  3. overloading operator problems
    By almich in forum C++ Programming
    Replies: 2
    Last Post: 07-26-2004, 04:10 PM
  4. operator overloading
    By blue_gene in forum C++ Programming
    Replies: 6
    Last Post: 04-29-2004, 04:06 PM
  5. overloading
    By theLukerBoy in forum C++ Programming
    Replies: 6
    Last Post: 11-04-2002, 08:49 PM