When applying a function to a collection of elements, std::transform takes the output as 3rd parameter. Is there version which returns the result, something like vec2 = map(func, vec1)?
When applying a function to a collection of elements, std::transform takes the output as
Share
No, there is nothing like that in the standard library. You can write one yourself:
A better solution may be to use
transformedadaptor from Boost.Range as it does not allocate additional container.