Implementing comparison operators via ‘tuple’ and ‘tie’, a good idea?

This is certainly going to make it easier to write a correct operator than rolling it yourself. I’d say only consider a different approach if profiling shows the comparison operation to be a time-consuming part of your application. Otherwise the ease of maintaining this should outweigh any possible performance concerns.

Leave a Comment