Templates when using non arithmetic operators
===

I am trying to achieve a very simple thing using C++ templates. I would like to build a generic sign function that could handle the case `sgn(x)`where x could be either `double `or `std::vector<double>` (that is returning a `std::vector<double>` containing the results). In order to achieve that I am using templates

<!-- language: lang-cpp -->

    double f(double x) {
        return (x>=0)?1:0;
    };

    template<typename T>
    T F(T x) {
       // ?
    };

I would like to cast the template and either use `f` if `double` or a `for` loop if `std::vector<double>`. Unfortunately my function does not use any arithmetic operator and the conditional operator cannot be overloaded. How should I proceed ?