Le 11/04/2017 à 10:04, Jean-Marc Lasgouttes a écrit :
Le 11/04/2017 à 09:45, Guenter Milde a écrit :
The Python convention is to leave out "== true" while in C++ this may be
required. (Python auto-converts any value to a Boolean if required in an
"if" clause.)

I do not see any reason to keep == true in C++ either.


As Günter said this can be necessary if the class does not define
operator(bool). Before C++11, operator bool() could not be made explicit
and therefore defining operator bool() was discouraged. But there is no
longer any reason to define operator==(bool) instead of operator bool()
now that it can be made explicit.

But this issue will not arise with the LyX source since all occurrences
of "x == true" involve a boolean according to a quick check (this can
probably happen to anybody at the end of a long day...).

Amusingly, there are no occurrences of "== false".

Reply via email to