    template<class T, class R = void>  
    struct enable_if_type
    {
        typedef R type;
    };
 
    template<class E, class Enable = void>
    struct GetFloatType
    {
        typedef E type;
    };
 
    template<class E>
    struct GetFloatType<E, typename enable_if_type<typename E::Scalar>::type>
    {
        typedef typename E::Scalar type;
    };
    
    template<class E>
    struct GetFloatType<E, typename enable_if_type<typename E::Inner>::type>
    {
        typedef typename E::Inner type;
    };
 
 #include <typeinfo>
 #include <iostream>
    template <class Elemtype, class Floattype = typename GetFloatType<Elemtype>::type>
    class ExponentialSmoother
    {
        public:
        void print()
        {
            std::cout << "Elem: " << typeid(Elemtype).name()
                << ", Float: " << typeid(Floattype).name() << "\n";
        }
    };
 
    template<typename T>
    class Vector
    {
        public:
        typedef T Scalar;
    };
 
    template<typename T>
    class Vector2
    {
        public:
        typedef T Inner;
    };
    
    class Vec : public Vector<double>, public Vector2<float>
    {
    
    };
 
int main()
{
    ExponentialSmoother<Vector<float> >().print();
    ExponentialSmoother<Vector2<float> >().print();
    ExponentialSmoother<double>().print();
    ExponentialSmoother<double,char>().print();
    // The following is ambiguous: Vec::Inner or Vec::Scalar ?
    //ExponentialSmoother<Vec>().print();
}