Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the range interface for optional #131

Open
akrzemi1 opened this issue Sep 9, 2024 · 3 comments
Open

Implement the range interface for optional #131

akrzemi1 opened this issue Sep 9, 2024 · 3 comments

Comments

@akrzemi1
Copy link
Member

akrzemi1 commented Sep 9, 2024

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

@typenameTea
Copy link
Contributor

Thanks for raising the issue 🙂

I'll be looking into implementing this

@akrzemi1
Copy link
Member Author

Thank you!

@akrzemi1
Copy link
Member Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants