Replace most Optional<T&> with T*.
#1898
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I did this mostly to see if copilot-cli could do it, and it was able to do most of it. There's no 'business case' to merge it and it will create merge conflicts. But it is a style change I've wanted to do for ages and just never found the time to do; the changes seemed 'local' enough that LLMs may be able to do it so that's what I tried. Would be totally happy to throw this away as a result.
Note that
src/vcpkg/commands.check-support.cppwas previously copying thePlatformExpression::Contextwhen the behavior everywhere else in vcpkg is to use the returned context directly, so that is a behavior change.Remaining
Optional<T&>uses:Optional<T&>itselfadapt_context_to_expected's handling ofOptional<T&>(in particular, that that needs to be treated like an lvalue even though a returnedOptional<T&>is usually a prvalue)InstallPlanAction::source_control_file_and_locationremoved in Remove optionality in ActionPlan and Summary #1894