From 4b782d7af3946d2c501f9db01c246a3089370b36 Mon Sep 17 00:00:00 2001 From: Stephen Kennedy Date: Tue, 29 Oct 2013 13:16:09 +0000 Subject: [PATCH] Add a test case for the Curiously Recurring Template Pattern --- tests/Basic/Basic.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/Basic/Basic.h b/tests/Basic/Basic.h index 78ecdcde..95a7f34a 100644 --- a/tests/Basic/Basic.h +++ b/tests/Basic/Basic.h @@ -153,3 +153,13 @@ struct DLL_API DefaultParameters void Bar() const; void Bar(); }; + +// The Curiously Recurring Template Pattern (CRTP) +template +class Base +{ + // methods within Base can use template to access members of Derived +}; +class Derived : public Base +{ +};