Listing 5: Functor CustomerOrderProcessor.
#if !defined(CUSTOMERORDERPROCESSOR__H) #define CUSTOMERORDERPROCESSOR__H #include "CustomerOrder.h" #include <iostream> class CustomerOrderProcessor { public: //The processings for the business order would go here. //For simplicity, it only prints the order out void operator() (const CustomerOrder& co) { std::wcout << co; } }; #endif