Skip to content

Instantly share code, notes, and snippets.

View frak0d's full-sized avatar

frak0d

  • Himalayas
  • 01:09 (UTC +05:30)
View GitHub Profile
@frak0d
frak0d / C++ normal operators.md
Created April 19, 2022 17:00 — forked from beached/C++ normal operators.md
A list of the normal signatures of C++ operators that allow overloading

C++ Operator Signatures

This is a list of C++ operators that can be overloaded and their normal signatures(a.k.a what an int would do). The order is the preffered order to use them(The first one listed is often preffered)

Arithmetic

operator+ addition

  • free function -> T operator+( T const & lhs, T const & rhs )
  • member function -> T operator+( T const & rhs ) const

operator+ unary plus

  • member function -> T operator+( ) const