Re:C++23: The Next C++ Standard
by cogman10 on Tuesday July 11, 2023 @06:46PM
(#36688257)
I tend to agree with this. I like operator overloading for mathematical constructs (like complex numbers or even just for conversions of literal types, Imagine, for example, you have a gram type and a second type, if you said 1g / 1s you'd get 1gps, that seems reasonable)
I don't like it in the example given
for (int i : std::views::iota(0, 6)
| std::views::filter(even)
| std::views::transform(square))
What benefit does this have over the Javay/Rusty version that looks like this
for (int i : std::views::iota(0, 6)
.filter(even)
.transform(square))
?
No deducing what `|` means, you are applying the filter then transform function against the view.
I don't like it in the example given
What benefit does this have over the Javay/Rusty version that looks like this ?No deducing what `|` means, you are applying the filter then transform function against the view.