Skip to content

Conversation

@steve-downey
Copy link
Member

No description provided.

steve-downey and others added 30 commits March 9, 2025 14:21
Use convert-ref-init-val to convert a U to a T& and initialize value with its
address.
GCC 15 correctly notes that 0xCAFEBABE is an unsigned int as an auto.
LEWG had several suggestions for wording.
Use conditional operator instead of if else.
- [X]  in p7 what is U? There is something missing
- [X]  it should be invoke_result_t<F>
- [X]  the definition of U should be consistent
- [X]  in p4: we shouldn’t use trailing return types here
Now that "contains a value" is defined for reference optionals.
steve-downey and others added 23 commits March 26, 2025 14:03
Update code, also
Add delegation for optional(nullopt_t) constructor.
Tref gets lost.
Fix include/beman/optional/optional.hpp:1368: optioanl ==> optional
Pin one side of value_or ternary to prevent ambiguity in conversions.
Should be "models invocable" not "models invocable<>"
1.  missing expos italization of val in contained value defn for optional<T&>

2. In iterator begin() since contained value is now a reference, change the
iterator referring to to be to *val

3. Add mandates for transform to require that the result of invoking the
supplied function to the contained value can create an object.
@steve-downey steve-downey requested review from a team and RaduNichita April 4, 2025 20:12
@coveralls
Copy link

Pull Request Test Coverage Report for Build 14273381629

Details

  • 18 of 18 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+2.0%) to 96.82%

Totals Coverage Status
Change from base Build 14265872253: 2.0%
Covered Lines: 274
Relevant Lines: 283

💛 - Coveralls

@@ -0,0 +1,25 @@
// examples/optional_ref.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting these examples!

https://wg21.link/P2988r9 std::optional<T&>
SD presenting
[optionalref.iterators]
TS: p1: “These types” -> “This type”
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please format them?

image

L.E. Why do we have duplicated notes?

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

Successfully merging this pull request may close these issues.

3 participants