junxnone / xwiki

https://junxnone.github.io/xwiki/
0 stars 0 forks source link

Programing CPP opoverloading #222

Open junxnone opened 1 year ago

junxnone commented 1 year ago

运算符重载

返回值类型 operator 运算符 (形参){

...
重载实现
...
}

可以重载的运算符

+ - * / % ^ & | ~ ! = < > += -= *= /= %= ^= &= |= << >> >>= <<= == != <= >= <=> (since C++20) && || ++ -- , ->* -> ( ) [ ]

Reference