Skip to content

Address deducing *this dependency #10

@camio

Description

@camio

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:

  1. Do nothing. Here we turn away many potential users and opportunities for feedback.
  2. Make a second structure available. Here we'd provide a iterator_interface_crtp which doesn't use deducing *this.
  3. 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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions