-
Operator> compares the current object to something else. Therefor one parameter.
bool operator>(const bar_all &that) const{ return this.value > that.value; }
-
Alternatively, define a stand-alone function (not a class method) that takes two arguments.
-
Generally you only need to define operator< and operator== and then
// doesn't compile with 1154 Jun/15 // '>' - semicolon expected // 'const' - name expected // '}' - expressions are not allowed on a global scope // #1255686 | 2015.07.08 21:05 // Operator Overloading can't be standalone functions // Service Desk: We do not support overriding global operators yet template <typename T> bool operator>(const T& lhs, const T& rhs){ return rhs < lhs; } template <typename T> bool operator<=(const T& lhs, const T& rhs){ return !(rhs < lhs); } template <typename T> bool operator>=(const T& lhs, const T& rhs){ return !(lhs < rhs); } template <typename T> bool operator!=(const T& lhs, const T& rhs){ return !(lhs == rhs); }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Where is the error in this code? Thank you!