Top "Operator-overloading" questions

Operator overloading is a feature of a programming language that allows custom implementations for operators depending on the types of the operands involved.

Operator overloading in C

I am trying to overload some operators: /* Typedef is required for operators */ typedef int Colour; /* Operators */ Colour operator+(Colour colour1, …

c operator-overloading
return value of operator overloading in C++

I have a question about the return value of operator overloading in C++. Generally, I found two cases, one is …

c++ operator-overloading
Operator Overloading with C# Extension Methods

I'm attempting to use extension methods to add an operater overload to the C# StringBuilder class. Specifically, given StringBuilder sb, …

c# extension-methods operator-overloading
overloading friend operator<< for template class

I have read couple of the questions regarding my problem on StackOverflow.com now, and none of it seems to …

c++ templates operator-overloading friend ostream
Pretty-print C++ STL containers

Please take note of the updates at the end of this post. Update: I have created a public project on …

c++ templates c++11 operator-overloading pretty-print
Is it possible to overload operators in PHP?

Specifically, I would like to create an Array class and would like to overload the [] operator.

php operator-overloading
Why must the copy assignment operator return a reference/const reference?

In C++, the concept of returning reference from the copy assignment operator is unclear to me. Why can't the copy …

c++ operator-overloading copy-constructor assignment-operator
C++ Overloading Conversion Operators

I am trying to have a class that allows implicit casting to certain built in types, like unsigned long int …

c++ operator-overloading const-correctness
C++ - overloading [] operator

I have a template class Array: template <class T=int, int SIZE=10> class Array { T TheArray[SIZE]; public: …

c++ operator-overloading overloading operator-keyword
c++ error C2662 cannot convert 'this' pointer from 'const Type' to 'Type &'

I am trying to overload the c++ operator== but im getting some errors... error C2662: 'CombatEvent::getType' : cannot convert 'this' …

c++ operator-overloading syntax-error friend-function