No, don’t roll your own. Instead, take a look at std::tuple
– it’s a generalization of std::pair
. So here’s a value-initialized triple of int
s:
std::tuple<int, int, int> triple;
If you want, you can have a type alias for triples only:
template<typename T1, typename T2, typename T3>
using triple = std::tuple<T1, T2, T3>;