#include <iostream>
using namespace std;

template<typename T>
struct Base { 
	int x;
	void print() {
		cout << "As Derived at " << static_cast<T*>(this) << ", as Base at " << this << ".\n";
	}
};
struct Derived: Base<Derived> { virtual ~Derived() {} };

int main()
{
    Derived d;
    d.print();
	cout << "Real Derived at " << &d << ".\n";
}