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.

C++ - must friend functions be defined in the header file?

I want to overload the operator << in one of my classes. The signature goes like this: friend std::…

c++ operator-overloading header-files friend
operator= and functions that are not inherited in C++?

Until a test I've just made, I believed that only Constructors were not inherited in C++. But apparently, the assignment …

c++ inheritance operator-overloading crtp
When to Overload the Comma Operator?

I see questions on SO every so often about overloading the comma operator in C++ (mainly unrelated to the overloading …

c++ function operator-overloading
Is there a workaround for overloading the assignment operator in C#?

Unlike C++, in C# you can't overload the assignment operator. I'm doing a custom Number class for arithmetic operations with …

c# operator-overloading
How arrow-> operator overloading works internally in c++?

I understand the normal operator overloading. Compiler can translate them to method call directly. I am not very clear about …

c++ operator-overloading
Are == and != mutually dependent?

I'm learning about operator overloading in C++, and I see that == and != are simply some special functions which can be …

c++ operator-overloading equality equality-operator
C++ Operator () parenthesis overloading

I recently asked a question about removing items from a vector. Well, the solution I got works, but I don't …

c++ operator-overloading remove-if
How can I use a custom type as key for a map in C++?

I am trying to assign a custom type as a key for std::map. Here is the type which I …

c++ struct key operator-overloading stdmap
std::endl is of unknown type when overloading operator<<

I overloaded operator << template <Typename T> UIStream& operator<<(const T); UIStream my_stream; …

c++ stl operator-overloading
How can I reliably get an object's address when operator& is overloaded?

Consider the following program: struct ghost { // ghosts like to pretend that they don't exist ghost* operator&() const volatile { return 0; } }; …

c++ c++11 operator-overloading memory-address