KDAlgorithms icon indicating copy to clipboard operation
KDAlgorithms copied to clipboard

Constrain the boolean operators

Open dangelog opened this issue 3 years ago • 0 comments

The convenience operators should be constrained to only take predicates or similar. Otherwise, if they're in scope, then all sorts of nonsense starts compiling:

using namespace KDAlgorithms::Operators;
std::string to_be;

to_be || !to_be; // that is the question

(Granted, one can't really use the return value of these operators, as it would immediately then trigger compilation errors)

dangelog avatar Sep 08 '22 11:09 dangelog