-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
This code, unlike the implementation used in beman.optional26, depends on deducing *this, a C++23 feature. This dependency makes it impossible to evaluate the library in projects that are using C++20 and earlier toolchains.
We could conditionally compile an implementation that doesn't depend on deducing *this, but this changes the interface. With deducing this, note that the CRTP isn't used,
template <class IteratorConcept,
class ValueType,
class Reference = ValueType&,
class Pointer = ValueType*,
class DifferenceType = ptrdiff_t>
class iterator_interface;
With the Boost, version, the CRTP is used. Note the Derived
template argument.
template <typename Derived,
typename IteratorConcept,
typename ValueType,
typename Reference = ValueType&,
typename Pointer = ValueType*,
typename DifferenceType = std::ptrdiff_t
>
struct iterator_interface;
Here are some possible ways to address this:
- Do nothing. Here we turn away many potential users and opportunities for feedback.
- Make a second structure available. Here we'd provide a
iterator_interface_crtp
which doesn't use deducing *this. - Provide different interfaces based on a build setting. In this case we'd have a configuration variable that would select whether the CRTP or deducing this interface is available.
Metadata
Metadata
Assignees
Labels
No labels