refactor: modernize ext::optional shim to std::optional (C++17), remove QL_USE_STD_OPTIONAL#5
Open
tobydrinkall wants to merge 9 commits into
Open
refactor: modernize ext::optional shim to std::optional (C++17), remove QL_USE_STD_OPTIONAL#5tobydrinkall wants to merge 9 commits into
tobydrinkall wants to merge 9 commits into
Conversation
…ent/cashflow Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
…ss all files Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
…o deprecated forwarding header Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Replaces all
ext::optional/ext::nulloptusages withstd::optional/std::nulloptdirectly, removes the deadQL_USE_STD_OPTIONALbuild flag (it was already defaulted ON), and reducesql/optional.hppto a thin deprecated forwarding header (#include <optional>).Since
QL_USE_STD_OPTIONALwas ON by default,ext::optionalalready resolved tostd::optional— so this is a type-alias-only change with zero semantic impact. The Boost path (boost::optional) is eliminated; it was already guarded by a#erroron Boost ≥ 1.91 due to silent behavior changes.Dependency Blast Radius
ext::optionaloccurrences migratedext::nulloptoccurrences migrated#include <ql/optional.hpp>→#include <optional>QL_USE_STD_OPTIONALreferences removedMigration Order (commits follow this bottom-up order, each builds green)
settings.hpp,event.hpp,cashflow.hpp+.cpp) — price-control APIscashflows/(8 files)instruments/(21 files)pricingengines/(16 files)termstructures/(11 files)experimental/+time/(10 files)test-suite/(9 files)#includedirectivesQL_USE_STD_OPTIONALfrom build system + reduce shimFlag Teardown
Removed from:
CMakeLists.txt,CMakePresets.json(both*-nonstandard-optionspresets),configure.ac,ql/userconfig.hpp,ql/config.hpp.cfg,.ci/userconfig{2019,2022,2026}.alt.hpp,Docs/pages/config.docs.Verification Results
Test-suite: 100% passed, 0 failed (182 suites / 1,321 cases, 306.85s).
Numeric equivalence (master vs branch, 20 examples):
18/18 deterministic examples: byte-identical (2,147 total lines compared).
*DiscreteHedging (MC) and GlobalOptimizer (differential evolution) are inherently non-deterministic: two sequential runs of the same master binary also produce different output, confirming stochastic RNG-seeded processes unrelated to the migration.
Zero leftovers:
Link to Devin session: https://app.devin.ai/sessions/a007a5cdfb1842729b8875e744ed3b8b
Requested by: @tobydrinkall
Devin Review