[meta.reflection.operators] # 21 Metaprogramming library [[meta]](./#meta) ## 21.4 Reflection [[meta.reflection]](meta.reflection#operators) ### 21.4.5 Operator representations [meta.reflection.operators] [🔗](#itemdecl:1) `enum class [operators](#lib:operators "21.4.5 Operator representations [meta.reflection.operators]") { see below; }; using enum operators; ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3566) The enumeration type operators specifies constants used to identify operators that can be overloaded, with the meanings listed in Table [63](#tab:meta.reflection.operators "Table 63: Enum class operators")[.](#1.sentence-1) The values of the constants are distinct[.](#1.sentence-2) Table [63](#tab:meta.reflection.operators) — Enum class operators [[tab:meta.reflection.operators]](./tab:meta.reflection.operators) | [🔗](#tab:meta.reflection.operators-row-1)
**Constant** | **Corresponding [*operator-function-id*](over.oper.general#nt:operator-function-id "12.4.1 General [over.oper.general]")** | **Operator symbol name** | | --- | --- | --- | | [🔗](#tab:meta.reflection.operators-row-2)
op_new | operator new | new | | [🔗](#tab:meta.reflection.operators-row-3)
op_delete | operator delete | delete | | [🔗](#tab:meta.reflection.operators-row-4)
op_array_new | operator new[] | new[] | | [🔗](#tab:meta.reflection.operators-row-5)
op_array_delete | operator delete[] | delete[] | | [🔗](#tab:meta.reflection.operators-row-6)
op_co_await | operator co_await | co_await | | [🔗](#tab:meta.reflection.operators-row-7)
op_parentheses | operator() | () | | [🔗](#tab:meta.reflection.operators-row-8)
op_square_brackets | operator[] | [] | | [🔗](#tab:meta.reflection.operators-row-9)
op_arrow | operator-> | -> | | [🔗](#tab:meta.reflection.operators-row-10)
op_arrow_star | operator->* | ->* | | [🔗](#tab:meta.reflection.operators-row-11)
op_tilde | operator~ | ~ | | [🔗](#tab:meta.reflection.operators-row-12)
op_exclamation | operator! | ! | | [🔗](#tab:meta.reflection.operators-row-13)
op_plus | operator+ | + | | [🔗](#tab:meta.reflection.operators-row-14)
op_minus | operator- | - | | [🔗](#tab:meta.reflection.operators-row-15)
op_star | operator* | * | | [🔗](#tab:meta.reflection.operators-row-16)
op_slash | operator/ | / | | [🔗](#tab:meta.reflection.operators-row-17)
op_percent | operator% | % | | [🔗](#tab:meta.reflection.operators-row-18)
op_caret | operator^ | ^ | | [🔗](#tab:meta.reflection.operators-row-19)
op_ampersand | operator& | & | | [🔗](#tab:meta.reflection.operators-row-20)
op_equals | operator= | = | | [🔗](#tab:meta.reflection.operators-row-21)
op_pipe | operator| | | | | [🔗](#tab:meta.reflection.operators-row-22)
op_plus_equals | operator+= | += | | [🔗](#tab:meta.reflection.operators-row-23)
op_minus_equals | operator-= | -= | | [🔗](#tab:meta.reflection.operators-row-24)
op_star_equals | operator*= | *= | | [🔗](#tab:meta.reflection.operators-row-25)
op_slash_equals | operator/= | /= | | [🔗](#tab:meta.reflection.operators-row-26)
op_percent_equals | operator%= | %= | | [🔗](#tab:meta.reflection.operators-row-27)
op_caret_equals | operator^= | ^= | | [🔗](#tab:meta.reflection.operators-row-28)
op_ampersand_equals | operator&= | &= | | [🔗](#tab:meta.reflection.operators-row-29)
op_pipe_equals | operator|= | |= | | [🔗](#tab:meta.reflection.operators-row-30)
op_equals_equals | operator== | == | | [🔗](#tab:meta.reflection.operators-row-31)
op_exclamation_equals | operator!= | != | | [🔗](#tab:meta.reflection.operators-row-32)
op_less | operator< | < | | [🔗](#tab:meta.reflection.operators-row-33)
op_greater | operator> | > | | [🔗](#tab:meta.reflection.operators-row-34)
op_less_equals | operator<= | <= | | [🔗](#tab:meta.reflection.operators-row-35)
op_greater_equals | operator>= | >= | | [🔗](#tab:meta.reflection.operators-row-36)
op_spaceship | operator<=> | <=> | | [🔗](#tab:meta.reflection.operators-row-37)
op_ampersand_ampersand | operator&& | && | | [🔗](#tab:meta.reflection.operators-row-38)
op_pipe_pipe | operator|| | || | | [🔗](#tab:meta.reflection.operators-row-39)
op_less_less | operator<< | << | | [🔗](#tab:meta.reflection.operators-row-40)
op_greater_greater | operator>> | >> | | [🔗](#tab:meta.reflection.operators-row-41)
op_less_less_equals | operator<<= | <<= | | [🔗](#tab:meta.reflection.operators-row-42)
op_greater_greater_equals | operator>>= | >>= | | [🔗](#tab:meta.reflection.operators-row-43)
op_plus_plus | operator++ | ++ | | [🔗](#tab:meta.reflection.operators-row-44)
op_minus_minus | operator-- | -- | | [🔗](#tab:meta.reflection.operators-row-45)
op_comma | operator, | , | [🔗](#lib:operator_of) `consteval operators operator_of(info r); ` [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3633) *Returns*: The value of the enumerator from operators whose corresponding [*operator-function-id*](over.oper.general#nt:operator-function-id "12.4.1 General [over.oper.general]") is the unqualified name of the entity represented by r[.](#2.sentence-1) [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3639) *Throws*: meta​::​exception unlessr represents an operator function or operator function template[.](#3.sentence-1) [🔗](#lib:symbol_of) `consteval string_view symbol_of(operators op); consteval u8string_view u8symbol_of(operators op); ` [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3653) *Returns*: A string_view or u8string_view containing the characters of the operator symbol name corresponding to op, respectively encoded with the ordinary literal encoding or with UTF-8[.](#4.sentence-1) [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3659) *Throws*: meta​::​exception unless the value of op corresponds to one of the enumerators in operators[.](#5.sentence-1)