Browse Source

Add a test case for the Curiously Recurring Template Pattern

pull/90/head
Stephen Kennedy 12 years ago
parent
commit
4b782d7af3
  1. 10
      tests/Basic/Basic.h

10
tests/Basic/Basic.h

@ -153,3 +153,13 @@ struct DLL_API DefaultParameters @@ -153,3 +153,13 @@ struct DLL_API DefaultParameters
void Bar() const;
void Bar();
};
// The Curiously Recurring Template Pattern (CRTP)
template<class Derived>
class Base
{
// methods within Base can use template to access members of Derived
};
class Derived : public Base<Derived>
{
};

Loading…
Cancel
Save