I have a set of types which are all arithmetic (have operators for addition, subtraction, multiplication, etc.). I want to aggregate any number of them into a single object, so I'm using the std::tuple class template and the <tuple> library (and Boost.Tuple for backward compatibility).
My question is a bit of a shot in the dark: Has anyone heard or seen a tuple-like class template that implements all the arithmetic operators?
For example, the std::tuple and boost::tuple classes both implement all the comparison operators which will only compile correctly if all the types contained in the tuple also have the comparison operators in question. I am wondering why there aren't the same provisions for the arithmetic operators?
I could easily implement this myself (but it can amount to a bit of trouble especially for backward compatibility with C++03), but I'm just wondering if anyone heard of one "arithmetic tuple" template that exists already.
Edited 5 Years Ago by mike_2000_17: n/a