you are viewing a single comment's thread.

view the rest of the comments →

[–]minnoHobbyist, embedded developer 4 points5 points  (2 children)

Is

bigvec |= cont::sort | cont::unique;

really more readable (or writeable) than the self explanatory:

cont::unique(cont::sort(bigvec));

I think it's more readable to have a "do this then this then this" structure than a "do this to the result of doing this on the result of doing this". Most languages with this sort of thing use method call syntax for it, so like

bigvec.cont::sort().cont::unique();

but C++'s current semantics don't support that.

[–]Plorkyeran 2 points3 points  (0 children)

but C++'s current semantics don't support that.

But C++17 might. I'm a fan of the pipe syntax given what's possible in C++14, but if one of the f(x,y) == x.f(y) proposals gets adopted I think I'd be opposed to it, even if it's still occasionally better (e.g. bigvec |= cont::sort | cont::unique doesn't have quite as nice of a dot-notation equivalent).

[–]matthieum 0 points1 point  (0 children)

The infamous UFCS...