Introduce new class IteratorFacade and add proxy iterator support
-
Review changes -
-
Download -
Patches
-
Plain diff
The new CRTP-mixin class IteratorFacade
is parameterized
by implementation, iterator category, value_type
, reference
,
pointer
, and difference_type
. Discussion of the changes:
- Making the iterator category a template parameter, allows to work with the facades class in a more uniform way. E.g. comparisons only need to be defined once for all categories.
- Being able to customize
pointer
allows to use the facade classes for proxy-iterators. This was not possible before, because it is not sufficient to simply exchange thereference
type to support proxies. - The design is in line with the
std::iterator_interface
proposal, in the sense that the template parameters have the same order to avoid surprises. Notice however, that this is not a drop-in replacement for two reasons:-
std::iterator_interface
is parameterized by the iterator concept instead of the category tag. -
srd::iterator_interface
avoids classic CRTP by deducingthis
.
-
The old facade classes are aliases toIteratorFacade
with the appropriate category tag. They also now have an additional template parameter forpointer
that defaults tovalue_type*
. Notice that the position of this template parameter is (confusingly, but for good reason) different toIteratorFacade
: For the old facade classes it is appended to keep backward compatibility, forIteratorFacade
it follows the order ofstd::iterator_interface
.- The old facade classes remain unchanged for backward compatibility reasons.
A major consequence of this change is, that it allows to
use the facades for proxy-iterators, like e.g. TransformedRangeIterator
.
In this case you have to specify a suitable proxy-type for
the pointer. In this case the new helper Dune::ProxyArrowResult
can
be used. This was adopted from the TransformedRangeIterator
, but
the name was adjusted to the std::iterator_interface
proposal.
This MR also includes some cleanups to TransformedRangeIterator
made possible by the new facades and preparing it for supporting
free operators.
Edited by Carsten Gräser
Merge request reports
Compare and
- version 36b356d377
- version 35b356d377
- version 34b356d377
- version 33b8f36ec3
- version 32b8f36ec3
- version 31b8f36ec3
- version 30b8f36ec3
- version 2904b85177
- version 2804b85177
- version 2704b85177
- version 2604b85177
- version 25d9b64c4a
- version 24d9b64c4a
- version 23d9b64c4a
- version 22d9b64c4a
- version 2198c4dd81
- version 2098c4dd81
- version 1998c4dd81
- version 1898c4dd81
- version 170cf9c439
- version 168579a7ae
- version 15aba77e35
- version 1497a38ecb
- version 130dacc02c
- version 12c8bb33e8
- version 1100912934
- version 105d599442
- version 91d7e0ddd
- version 8567da19a
- version 71bdc79ae
- version 61bdc79ae
- version 5208b0411
- version 4a0f3d7a4
- version 3bc818f0b
- version 24e923517
- version 17417aa05
- master (base)
- latest versionb356d3778 commits,
- version 36b356d3778 commits,
- version 35b356d3778 commits,
- version 34b356d3778 commits,
- version 33b8f36ec38 commits,
- version 32b8f36ec38 commits,
- version 31b8f36ec38 commits,
- version 30b8f36ec38 commits,
- version 2904b851777 commits,
- version 2804b851777 commits,
- version 2704b851777 commits,
- version 2604b851777 commits,
- version 25d9b64c4a5 commits,
- version 24d9b64c4a5 commits,
- version 23d9b64c4a5 commits,
- version 22d9b64c4a5 commits,
- version 2198c4dd815 commits,
- version 2098c4dd815 commits,
- version 1998c4dd815 commits,
- version 1898c4dd815 commits,
- version 170cf9c4396 commits,
- version 168579a7ae5 commits,
- version 15aba77e356 commits,
- version 1497a38ecb5 commits,
- version 130dacc02c4 commits,
- version 12c8bb33e84 commits,
- version 11009129344 commits,
- version 105d5994425 commits,
- version 91d7e0ddd4 commits,
- version 8567da19a4 commits,
- version 71bdc79ae4 commits,
- version 61bdc79ae5 commits,
- version 5208b04115 commits,
- version 4a0f3d7a45 commits,
- version 3bc818f0b4 commits,
- version 24e9235173 commits,
- version 17417aa053 commits,
Compare changes
- Side-by-side
- Inline
Files
4Loading