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:
fbbrokken 2007-04-30 11:24:34 +00:00
parent 8329bea14c
commit 1da928e493

View file

@ -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