Fix optional::emplace() #126
Merged
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.
This wasn't marking the newly-constructed value present.
Also replace unchecked access to _value with checked access for the various operators.
This manifested as an exception when running into fallback choices, as the newly-emplaced() choice container wasn't valid at runner_impl.cpp(1379).
NB: For context, I'm doing an experimental integration into a non-Unreal, non-STL, non-EH C++ game engine, so probably using some things in ways they aren't normally used. I had to do some config fiddling to get things working but with this fix it's running nicely with not too much code on my side :)
If you're interested I can turn the config changes into a PR as well, but that probably needs some discussion about the best way to make them.