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:
“A creature not too bright or good
For human natures daily food;
For transient sorrows, simple wiles,
Praise, blame, love, kisses, tears, and smiles.”
—William Wordsworth (17701850)
“no thread
Of cloudy silver sprinkles in your gown
Its venom of renown, and on your head
No crown is simpler than the simple hair.”
—Wallace Stevens (18791955)