In this code snippet taken from http://drdobbs.com/cpp/184403774 :
template <class L, class R> class MinResult { L& lhs_; R& rhs_; public: operator L&() { return lhs_ < rhs_ ? lhs_ : rhs_; }
What is the code you are trying to do in the lines indicated by arrows?
I am starting in C ++, and I understand that we can override / define operator() by defining it.
But then it should not be defined as
L& operator() { return lhs_ < rhs_ ? lhs_ : rhs_; }
I am sure this is some kind of different syntax, since operator() should be one word. In addition, you cannot define two of them with different types of returned data.
source share