Neither version of your code compiles with gcc 4.1.0.
The function declaration
template<typename T> typename Trait<T>::Type get() const;
won't work, since the return value is not part of the function signature.
Did you actually try to call/instantiate this function ?
For instance:
void foo(){ Base bi; int ib = bi.get(); Base bf; float fb = bf.get(); Derived<int> di; int id = di.get(); Derived<float> df; float fd = df.get();}
The get() function of the Derived class will work, since there is just one version generated which depends on the template type of the Derived class.
The get() function of the Base class will not work, since many versions of this function may be generated and the return value is not used to select one. Either you can explicitly tell the compiler which function to use (i.e. get<int>()) or you can add a parameter which selects the function:
template<typename T> typename Trait<T>::Type get(T&) const;