Follow

Sad c++ programmers are so afraid to write new algorithms, that they have to resort to generators.

Instead of writing
transform(begin, end, dest, f);
ima write
copy(begin, end, tranformer(dest, f));
or
copy(transformed(begin, end, f), dest);

or instead of
copy_until(begin, dest, condition);
ima write
copy(begin, sentinel(condition), dest);
where the opertor != of begin and sentinel is overloaded to be the condition

look ma, I reuse copy, am galaxy brain, let me also overload another stupid operator so that this whole mess looks like this
copy( range | trasnform(f) | filter(f2), dest );
this is so readable, ma role model is haskell, the most bestest readable and not at all cryptic language.

oh no, wait, because of filter, transform is done twice for some elements... I mean, oh yeah, this is a feature!

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.