beman-project / iterator_interface

Apache License 2.0
1 stars 3 forks source link

Add stl_interfaces fallback when deducing this is unavailable. #13

Open camio opened 18 hours ago

camio commented 18 hours ago

Added a build option, BEMAN_ITERATOR_INTERFACE26_USE_DEDUCING_THIS, that switches between the deducing this implementation and that used by stl_interfaces. It defaults to whether the compiler supports deducing this.

This element of configuration is placed in a generated config.hpp. This was chosen, as opposed to using a define passed as a compiler flag, to avoid ODR violations with larger projects with incoherent flag usage.

The iterator_interface_access struct was moved to its own header since it is needed by both the deducing this and stl_interfaces implementations. The stl_interfaces implementation was modifed to use this so it better conforms to the paper.

Some cleanup is still needed before this gets merged in:

The intent is to address these once the overall approach has consensus.

Fixes #10 and depends on #12.