oneDPL
oneDPL copied to clipboard
[oneDPL] Added support C++ functor/lambda for permutation_iterator
[oneDPL] permutation_iterator and permutation_view improvements
- Added support usage case like in Boost (https://www.boost.org/doc/libs/1_38_0/libs/iterator/doc/permutation_iterator.html)
- Aded support C++ functor as an index map for permutation_iterator (https://oneapi-src.github.io/oneDPL/parallel_api/iterators.html).
- Added support C++ functor as an index map for permutation_view
- The test coverage was extended as well.
Am I right, that with your fix example from https://www.boost.org/doc/libs/1_66_0/libs/iterator/doc/html/iterator/specialized/permutation.html example will work OK and each of loops like std::copy( indices.begin(), indices.end(), std::ostream_iterator< int >( std::cout, " " ) ); will print all valued from container?
While I missed this PR before, in fact it introduces a breaking change. Before, a map "functor" needed to provide an indexing operator[], while now a function call operator() is needed. As far as I understand, the issue exists even in the specification (which shows an example with operator[]).
So this is one more thing that might need to be noticed on the "breaking changes" page. And I wonder what we should do with the specification...