#include <iostream>


template<class T> 
struct Base 
{
  typedef T type;
  static const int n = 3;
  virtual int f() = 0;
  int f(int x) { return x * 2; }
};

template<class T> 
struct Derived : Base<T> 
{
    using typename Base<T>::type;
    using Base<T>::n;

    type field;
    int f() { return n; }
};


int main()
{
	Derived<float> d;
	d.field = 42.0f;
	std::cout << d.f();
}