For me, one of the most interesting features in languages such as R or Scilab is the possibility of parallelizing operations by vectorizing functions ("meaning that the function will operate on all elements of a vector without needing to loop through and act on each element one at a time", in the words of The Carpentries). This is supposed to make the code clearer and faster to execute.
My question is: Is this a possibility in C or C++? Can we create functions in C that can operate either on a scalar or a vector? Can we use standard C functions as if they were vectorized?
Maybe C is so fast that you don't need this feature, but I want to be sure about this subject, since this would affect the way I translate algorithms into code.
To be more concrete, if I want to apply a function on each element of a vector in C, should I use a loop, or there are other alternatives?