From: Neil Groves (neilgroves_at_[hidden])
Date: 2020-05-11 18:23:35
On Sun, 29 Mar 2020 at 17:21, Frederick Gotham via Boost <
> Earlier today I wrote the following two lines of code:
> auto const my_range = v | boost::adaptors::sliced(1,15) |
> boost::range::transform( my_range, my_range.begin(),
> std::bit_not<uint8_t>() );
> However it would have been nice as a one-liner:
> boost::range::transform( v | boost::adaptors::sliced(1,15) |
> boost::adaptors::strided(2), std::bit_not<uint8_t>() );
> Why isn't there a form of "range::transform" that can transform in
> place (and therefore takes exactly two arguments)?
The reason is that when I first implemented the main algorithms I was
writing almost exact equivalents of the iterator-based algorithms in
<algorithm>. This is a missed opportunity to take advantage of the template
parameter deduction advantage of range parameters to support chaining.
I shall look at adding this. It may have to be spelled inplace_transform. I
need to consider the impact, backward compatibility, and any potential
confusion over the semantics. There is definitely something to be done to
Thanks for your report.
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk