Curiously Recurring Template Pattern - General Form

General Form

// The Curiously Recurring Template Pattern (CRTP) template class Base { // methods within Base can use template to access members of Derived }; class Derived : public Base { // ... };

Some use cases for this pattern are static polymorphism, and other metaprogramming techniques such as those described by Andrei Alexandrescu in Modern C++ Design. It also figures prominently in the C++ implementation of the Data, Context and Interaction paradigm .

Read more about this topic:  Curiously Recurring Template Pattern

Famous quotes containing the words general and/or form:

    A private should preserve a respectful attitude toward his superiors, and should seldom or never proceed so far as to offer suggestions to his general in the field. If the battle is not being conducted to suit him, it is better for him to resign. By the etiquette of war, it is permitted to none below the rank of newspaper correspondent to dictate to the general in the field.
    Mark Twain [Samuel Langhorne Clemens] (1835–1910)

    Once one is caught up into the material world not one person in ten thousand finds the time to form literary taste, to examine the validity of philosophic concepts for himself, or to form what, for lack of a better phrase, I might call the wise and tragic sense of life.
    F. Scott Fitzgerald (1896–1940)