Skip to content
Snippets Groups Projects
Commit b356d377 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

Improve static diagnostics for IteratorFacade

We now give detailed error messages for each required feature
that is missing in the derived class. To get early diagnotics
the static assertions are even issued in the constructor even
if the corresponding methods are not called. I.e. whenever
you derive from `IteratorFacade<...>` and miss to implement
a feature a static assertion will fail listing which methods
are missing, if they should be const or mutable, for which
iterator category they are required.

To make this work from the constructor we have to enforce
instanciation of the methods by letting their return type deduce.
Otherwise this would fail late, only if the corresponding
method is used. Alternatively we could enforce instanciation
by obtaining the address of the methods in the constructor.
This however would be over-restrictive, since it fixes
the full signature and does not leave freedom for automatic
conversion of in- and output parameters.
parent 04b85177
1 merge request!1396Introduce new class IteratorFacade and add proxy iterator support
Pipeline #71808 passed
Pipeline: Dune Nightly Test

#71819

    Loading
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment