#include <iostream>
#include <vector>
#include <type_traits>

template <class Vector, class Scalar>
typename std::enable_if<std::is_floating_point<Scalar>::value, Vector>::type
operator*(const Scalar &a, const Vector &b)
{
    return Vector { a*b[0], a*b[1], a*b[2] };
}

int main()
{
    const std::vector<double> v1({1,2,3});
    const double s1(2);
    const auto result(s1*v1);
    std::cout << result[0] << ", " << result[1] << ", " << result[2] << std::endl;
}