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.

Creating `**` power operator for Scala?

I quite like the ** syntax for pow, available in many languages (such as Python). Is it possible to introduce this …

scala operators operator-overloading scala-2.10 pow
Eclipse complains: "Invalid overload of 'endl'" - but code does compile

I've written an operator<< for my templated class: template<class T> std::ostream& operator<&…

c++ templates operator-overloading eclipse-cdt
What makes Scala's operator overloading "good", but C++'s "bad"?

Operator overloading in C++ is considered by many to be A Bad Thing(tm), and a mistake not to be …

c++ scala operator-overloading
Why cannot a non-member function be used for overloading the assignment operator?

The assignment operator can be overloaded using a member function but not a non-member friend function: class Test { int a; …

c++ operator-overloading assignment-operator
How to overload operator<< for qDebug

I'm trying to create more useful debug messages for my class where store data. My code is looking something like …

c++ qt4 operator-overloading
Why would one replace default new and delete operators?

Why should would one replace the default operator new and delete with a custom new and delete operators? This is …

c++ operator-overloading new-operator c++-faq delete-operator
Overloading function call operator in C#

Is it possible to overload the default function operator (the () operator) in C#? If so - how? If not, is …

c# operator-overloading
Operator Overloading with Interface-Based Programming in C#

Background I am using interface-based programming on a current project and have run into a problem when overloading operators (specifically …

c# .net operator-overloading equals
Applications of '~' (tilde) operator in Python

I just discovered the bitwise complement unary operation in Python via this question and have been trying to come up …

python python-3.x operator-overloading bit-manipulation tilde