by MauranKilom · 6y ago · 0 comments
> This function attempts to allocate a temporary buffer equal in size to the sequence to be sorted. If the allocation fails, the less efficient algorithm is chosen.
Or is this not what you consider a "functional construct"?
But the C++ versions of these take the result location as an argument. It makes chaining them together a hassle because you have to create all the intermediate containers explicitly.
I think there are good reasons for the STL to work this way, but it can make programming in a functional style pretty inconvenient compared to a lot of other languages.
See e.g. here: https://github.com/ericniebler/range-v3/tree/master/example