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:
“How simple a thing it seems to me that to know ourselves as we are, we must know our mothers names.”
—Alice Walker (b. 1944)
“Historians desiring to write the actions of men, ought to set down the simple truth, and not say anything for love or hatred; also to choose such an opportunity for writing as it may be lawful to think what they will, and write what they think, which is a rare happiness of the time.”
—Sir Walter Raleigh (15521618)