According to N4295 C++17 will allow me to calculate the sum of an unknown number of arguments thus:
template<typename ... T>
int sum(T...t)
{
return (... + t);
}
The document further states that I could use operators such as == or > instead of +. Can anybody come up with a sensible example of when I would want to use == or > in such a construct?
(I realize that people can define == and > to do strange things to strange classes, but surely that violates good practice. Writing a > b > c > d
is hardly ever a good idea, is it?)