Hi I want to (multiply,add,etc) vector by scalar value for example myv1 * 3 , I know I can do a function with a forloop , but is there a way of doing this using STL function? Something like the {Algorithm.h :: transform function }?
Hi I want to (multiply,add,etc) vector by scalar value for example myv1 * 3
Share
Yes, using
std::transform:Before C++17 you could use
std::bind1st(), which was deprecated in C++11.For the placeholders;