mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
Clarified overloading/overloadable.yo
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@51 f6dd340e-d3f9-0310-b409-bdd246841980
This commit is contained in:
parent
8329bea14c
commit
1da928e493
1 changed files with 23 additions and 2 deletions
|
@ -7,8 +7,29 @@ The following hi(overloadable operators) operators can be overloaded:
|
|||
<<= >>= [] () -> ->* new new[]
|
||||
delete delete[]
|
||||
)
|
||||
When `textual' alternatives of operators are available (e.g., tt(and) for
|
||||
tt(&&)) then they are overloadable too.
|
||||
Several operators have em(textual alternatives):
|
||||
hi(operators: textual alternatives)
|
||||
table(2)(cl)(
|
||||
rowline()
|
||||
row(cell(textual alternative) cell(operator))
|
||||
rowline()
|
||||
row(cell( ti(and)hi(operator and())) cell(tt( && )))
|
||||
row(cell( ti(and_eq)hi(operator and_eq())) cell(tt( &= )))
|
||||
row(cell( ti(bitand)hi(operator bitand())) cell(tt( & )))
|
||||
row(cell( ti(bitor)hi(operator bitor())) cell(tt( | )))
|
||||
row(cell( ti(compl)hi(operator compl())) cell(tt( ~ )))
|
||||
row(cell( ti(not)hi(operator not())) cell(tt( ! )))
|
||||
row(cell( ti(not_eq)hi(operator not_eq())) cell(tt( != )))
|
||||
row(cell( ti(or)hi(operator or())) cell(tt( || )))
|
||||
row(cell( ti(or_eq)hi(operator or_eq())) cell(tt( |= )))
|
||||
row(cell( ti(xor)hi(operator xor())) cell(tt( ^ )))
|
||||
row(cell( ti(xor_eq)hi(operator xor_eq())) cell(tt( ^= )))
|
||||
rowline()
|
||||
)
|
||||
`Textual' alternatives of operators are also overloadable (e.g.,
|
||||
tt(operator and()). However, note that textual alternatives are not
|
||||
em(additional) operators. So, within the same context tt(operator&&()) and
|
||||
tt(operator and()) can not em(both) be overloaded.
|
||||
|
||||
Several of these operators may only be overloaded as member functions
|
||||
hi(operator overloading: within classes only) em(within) a class. This
|
||||
|
|
Loading…
Reference in a new issue