Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    cpp
  » Operator Overloading
      by Valmont
 Page 4 of 27 
< Previous     Next >

(Login to remove green text ads)
Chapter One: demonstration
Chapter One: demonstration


Sub Chapters
  • Returning By Reference.
  • Overloading The Addition Operator: operator+()
  • Efficiency And Neatness
  • Overloading Stream Operators


Intro

First we will recapitulate free functions returning a reference. You will need this in quite an early stage. The second operator that we will overload is the insertion operator. To enable chaining we have to return by reference. However, the very first overloaded operator will be the addition operator.
The second chapter will implement a simple addition member function. Then we'll add its overloaded operator equivalent. This will show you how operator overloading can be at your service.
The third sub chapter will cover Return By Value Optimization, a common technique used in C++ programming. Before you start here, I expect you to feel comfortable with constructors and temporary objects.
The Fourth chapter will implement a stream operator. Returning by reference becomes an issue here, as mentioned earlier. Make sure you feel comfortable with that first.

In general, if you meet the requirements as mentioned in the prerequisites, you'll have a very easy time here.




 
 Page 4 of 27 
< Previous     Next >

Rate This Article
1 2 3 4 5 6 7 8 9 10





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting