Simple Example
Presented below is a simple (contrived) example of a C++ hello world program, where the text to be printed and the method of printing it are decomposed using policies.
#includeYou could easily write another OutputPolicy by adding a new class with the member function print and take that as the new OutputPolicy.
Read more about this topic: Policy-based Design
Famous quotes containing the word simple:
“If when a businessman speaks of minority employment, or air pollution, or poverty, he speaks in the language of a certified public accountant analyzing a corporate balance sheet, who is to know that he understands the human problems behind the statistical ones? If the businessman would stop talking like a computer printout or a page from the corporate annual report, other people would stop thinking he had a cash register for a heart. It is as simple as thatbut that isnt simple.”
—Louis B. Lundborg (19061981)
“The real drawback to the simple life is that it is not simple. If you are living it, you positively can do nothing else. There is not time.”
—Katharine Fullerton Gerould (18791944)