With std::valarray instead of std::vector, you can compile exactly that line in C++, except you have to use the floating-point zero to compare to a valarray of floating-point values (or else make v2 a valarray<int>)
1 2 3 4 5 6 7 8 9 10 11 12
#include <valarray>
#include <iostream>
int main()
{
std::valarray<double> v1 = {0,0,0, 0, 0, 0,0,0,0};
std::valarray<double> v2 = {1,2,3,-1,-2,-3,0,0,0};
v1[v2 > 0.] = 1; // <-- here's your line
for(double d : v1) std::cout << d << ' ';
}