[over.binary.general]

# 12 Overloading [[over]](./#over)

## 12.4 Overloaded operators [[over.oper]](over.oper#over.binary.general)

### 12.4.3 Binary operators [[over.binary]](over.binary#general)

#### 12.4.3.1 General [over.binary.general]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L3530)

A [*binary operator function*](#def:operator_function,binary "12.4.3.1 General [over.binary.general]") is a function named operator@ for a binary operator @ that is either
a non-static member function ([[class.mfct]](class.mfct "11.4.2 Member functions")) with one non-object parameter or
a non-member function with two parameters[.](#1.sentence-1)

For an expression x @ y with subexpressions x and y,
the operator function is selected by overload resolution ([[over.match.oper]](over.match.oper "12.2.2.3 Operators in expressions"))[.](#1.sentence-2)

If a member function is selected,
the expression is interpreted as

x . operator @ ( y )

Otherwise, if a non-member function is selected,
the expression is interpreted as

operator @ ( x , y )

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L3550)

An [*equality operator function*](#def:operator_function,equality "12.4.3.1 General [over.binary.general]") is an operator function
for an equality operator ([[expr.eq]](expr.eq "7.6.10 Equality operators"))[.](#2.sentence-1)

A [*relational operator function*](#def:operator_function,relational "12.4.3.1 General [over.binary.general]") is an operator function
for a relational operator ([[expr.rel]](expr.rel "7.6.9 Relational operators"))[.](#2.sentence-2)

A [*three-way comparison operator function*](#def:operator_function,three-way_comparison "12.4.3.1 General [over.binary.general]") is an operator function
for the three-way comparison operator ([[expr.spaceship]](expr.spaceship "7.6.8 Three-way comparison operator"))[.](#2.sentence-3)

A [*comparison operator function*](#def:operator_function,comparison "12.4.3.1 General [over.binary.general]") is
an equality operator function,
a relational operator function, or
a three-way comparison operator function[.](#2.sentence-4)
