Repository navigation
Fix the build with Visual Studio 2026 (MSVC 14.50+) - #56
Merged
Merged
Conversation
VS 2026 (MSVC 14.50+) made _Has_static_min_max a variable template and then removed it, so the specialisation no longer compiles. Since VS 2022 17.12 generate_canonical works with AD types without it.
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.
QuantLibAAD fails to compile with the Visual Studio 2026 toolset (MSVC 14.50 and later):
ql/qlaad.hppspecialises the MSVC STL's internal_Has_static_min_maxtrait, which 14.50 turned into a variable template and 14.51 removed. The specialisation is only needed for STLs before VS 2022 17.12, whosestd::generate_canonicalbuilds constexpr values of the result type; later versions no longer do that and work with AD types directly.Changes
std::mt19937workaround only for MSVC STLs older than VS 2022 17.12.Testing
The Windows CI jobs build and run the QuantLib test suite with AD types, including the tests that draw from
stdrandom distributions withstd::mt19937(cat bond beta risk, firefly, particle swarm and simulated annealing optimizers). VS 2022 (17.14) now takes the standardgenerate_canonicalpath; the new VS 2026 job covers the toolset that failed.