#include // cout, endl #include // string #include // EXIT_SUCCESS #include "Pair.h" using std::cout; using std::endl; using std::string; int main(int argc, char** argv) { Pair ps; // this usage instantiates a class Pair string x("foo"), y("bar"); ps.set_first(x); // first_ = "foo", second_ = "" ps.set_second(y); // first_ = "foo", second_ = "bar" ps.Swap(); // first_ = "bar", second_ = "foo" cout << ps << endl; // nonmember overloaded operator<< invoked return EXIT_SUCCESS; }