Hacker News new | ask | show | jobs
by dnautics 1589 days ago
Why define an operator? That is just asking for trouble. If you absolutely must compare two such values, insist that the person do the conversion manually at the comparison site, so that the intent and local use case is made explicit. Because you may wind up in a situation where someone else in the same codebase needs a different "method of coercion", and operator creation is fairly global-ish in most PLs.