/////////////////////////////////////////////////////////////// // MT1Q7.cpp - Operation on Elements // // // // Jim Fawcett, CSE687 - Object Oriented Design, Spring 2012 // /////////////////////////////////////////////////////////////// #include "MT1Q7.h" int main() { std::cout << "\n MT1Q7 - Execute Operation on Members of Container"; std::cout << "\n ===================================================\n"; int collectionOfInts[] = { 0, 1, 2, 3, 4, 5 }; Container c; for(size_t i=0; i<6; ++i) c.push_back(collectionOfInts[i]); displayFunctor df; std::cout << "\n "; c.traverse(df); // providing operation with one line of code std::cout << "\n\n"; return 0; // Note: // You can give traverse any function that derives from IFunctor }