STL-pair-like triplet class – do I roll my own?

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 ints:

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>;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)