#ifndef SEC6_TRIPLE_H_ #include // A class representing a generic 3-tuple. template class Triple { public: Triple(T1 &x, T2 &y, T3 &z) : z_(z), y_(y), x_(x) { } // Simple member accessors. T1 get_x() { return x_; } T2 get_y() { return y_; } T3 get_z() { return z_; } void set_x(const T1 &x) { x_ = x; } void set_y(const T2 &y) { y_ = y; } void set_z(const T3 &z) { z_ = z; } private: T1 x_; T2 y_; T3 z_; } // Pass the tuple in the standard format "(x,y,z)" to the out ostream. template std::ostream &operator<<(std::ostream &out, const Triple &rhs) { out << "(" << rhs.get_x() << "," << rhs.get_y() << "," << rhs.get_z() << ")"; return out; } #endif // SEC6_TRIPLE_H_