#include <iostream>
#include <type_traits>

template<class Typ>
class base {
public:
    const base<Typ> operator+() const{
        base<Typ> result;
        result.fElement = +fElement;
        return result;
    }

    template<typename T>
    typename std::enable_if<std::is_same<T, base<double>>::value,
    const base<double>>::type
    operator^(const T& rgh) const
    {
        std::cout << fElement << " ^ " << rgh.fElement << '\n';
        return *this;
    }
private:
    Typ fElement;
};

typedef base<double> derived;

int main(){
    derived a, b;
    +a;     // It compiles
    a^b;        // It compiles
    +a^b;       // It compiles
    +(a^b);     // It compiles

    base<int> c;
    +c; // It compiles
//     c^c; // no ^ for base<int>
}
