-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify Null<T>
implementation
#2082
Conversation
I'll try, I have to ask our windows devs if they still have the particular msvc version in use! If you don't hear back on this, please assume there is no problem :-) |
Looks like this caused some issue in Windows with C++17 for us though: https://github.com/auto-differentiation/QuantLib-Risks-Cpp/actions/runs/11174316341 We'll look into it shortly, might be something small / fixable in our code. Curious that it's Windows-only though, and works fine with Windows/C++20. |
Ok, thanks. |
Question—to what does |
We provide a standard compatibility header in XAD, which specialises those traits so that the XAD active types behave like the standard floating point types. This allows them to be used seamlessly with the standard library and eases porting existing codebases like QuantLib. We test this on all possible compilers we support to make sure it works smoothly. The problem with |
Great, thanks. |
Null<T>
(both function and class) withconstexpr if
, which is simpler to read and also more flexible since we can now define a reasonable default for non-numeric types and thus remove the specializations we used to need;Array x = Null<Array>()
is probably more readable asArray x = {}
;Null<Date>()
and sometimes asDate()
, I settled on the latter throughout.