Skip to content

Implement the range interface for optional #131

Open

Description

@akrzemi1

Implement P3168R2 in Boost.Optional in a C++11-compatible manner.

Activity

  1. typenametea commented on Sep 9, 2024

    @typenametea
    Contributor

    Thanks for raising the issue 🙂

    I'll be looking into implementing this

  2. akrzemi1 commented on Sep 10, 2024

    @akrzemi1
    MemberAuthor

    Thank you!

  3. akrzemi1 commented on Sep 10, 2024

    @akrzemi1
    MemberAuthor

    The following are criteria for a successful implementation.

    • Boost.Optional works for objects (implementation is in here), and is also specialized for lvalue references (implementation is here). The range interface should also work for optional references.
    • Unit tests, apart from testing the presence of new members and their type, should also demonstrate that optional objects and optioal references can work with a range-based for-loop.
    • Paper P3168r2 shows examples how the new interface of optional interoperates with C++20 ranges. It would be nice to have such tests also. I do not consider them absolutely necessary. But these tests should be conditionally compiled, as otherwise they would break on pre-C++20 compilers.
    • The "reference" part of the documentation should reflect the new interface. I mean files 27_ref_optional_synopsis.qbk and 28_ref_optional_semantics.qbk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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