Tells the operators one can override; which operators , C/C++ Programming

Q:  Tells the operators one can override; which operators should he override?

A: Bottom line: don't puzzle your users.

Remember the reason of operator overloading: to decrease the cost and defect rate in code that uses your class. If you create operators which confuse users (because they're cool, because they make the code faster, since you have to prove to yourself that you can do it; doesn't really matter why), you've violated the entire reason for using operator overloading in the first place.


Posted Date: 3/20/2013 3:47:55 AM | Location : United States

Related Discussions:- Tells the operators one can override; which operators , Assignment Help, Ask Question on Tells the operators one can override; which operators , Get Answer, Expert's Help, Tells the operators one can override; which operators Discussions

Write discussion on Tells the operators one can override; which operators
Your posts are moderated
Related Questions
Differences between a pointer and a reference 1.  A reference must always point to some object where as this restriction is not imposed on a pointer. e.g. int *pi = 0;

Question: (a) Write short notes on arrays. Extend your answer by putting emphasis on memory allocation. (b) Write a C++ program to input an integer n followed by n real-

1) Database: The database needs to be used for persistent storage of cars. For details of what information should be stored in the database, please see the description above. You

Insertion sort - C program: Write a program in c to define a insertion sort. void main()  {   clrscr();   int a[100],ch,n;   cout   cin>>n;   for (int i=0

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Data is required to be fed into the program (input) and sent out of the program (output). Considering the draughtsman using a CAD station, the input is his commands to cause lines/

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Write a program that does the following: Calculates the Velocity and Momentum of an object. The formula for the velocity is V=d/t and the formula Momentum is m=mass*velocity. Your

Write a function that has four unsigned char parameters, combines the four one-byte integer values into an unsigned integer, and returns the unsigned integer. When the four one

A: By keeping along with the C++ tradition of "there's more than one method to do that" (translation: "give programmers options & tradeoffs so they can choose what's best for them