4 ms·
I know some basic C++ and STL. Is there anything like streams in C++. I mean things would be as easy as vec.stream().map(lambda).fold(T::operator+), so it would
by entha_saava 6y ago
I know some basic C++ and STL. Is there anything like streams in C++. I mean things would be as easy as vec.stream().map(lambda).fold(T::operator+), so it wouldn't require any more allocations than those done by copy constructors.
- MauranKilom 6y agoThe upcoming ranges library will provide exactly this! It uses | for composing operations. See e.g. here: https://github.com/ericniebler/range-v3/tree/master/example https://github.com/ericniebler/range-v3/tree/master/example