[ create a new paste ] login | about

Link: http://codepad.org/faB14asJ    [ raw code | output | fork ]

C++, pasted on Jan 17:
1
2
3
4
5
6
7
8
template <typename T>
struct Base { };

struct Derived : Base<Derived> { // I love the smell of CRTP in the morning
   Derived();
};

Derived::Derived() : Base() {};


Output:
1
2
3
t.cpp: In constructor 'Derived::Derived()':
Line 8: error: class 'Derived' does not have any field named 'Base'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: