#include #include #include using namespace std; // A class that stores a pair of things of type T. template class Pair { public: Pair() { } Pair(T a, T b) : first_(a), second_(b) { } void Print() { cout << "(" << first_ << "," << second_ << ")" << endl; } void Set(T a, T b) { first_ = a; second_ = b; } T first_, second_; }; int main(int argc, char **argv) { Pair stringpair("Hello", "world"); Pair *pairarr = new Pair[2]; pairarr[0].first_ = "ham"; pairarr[0].second_ = "cheese"; pairarr[1].Set("turtles", "facepaint"); stringpair.Print(); pairarr[1].Print(); delete[] pairarr; return EXIT_SUCCESS; }