Deprecate day-counter argument in z-spread functions#2465
Merged
lballabio merged 1 commit intolballabio:masterfrom Mar 4, 2026
Merged
Deprecate day-counter argument in z-spread functions#2465lballabio merged 1 commit intolballabio:masterfrom
lballabio merged 1 commit intolballabio:masterfrom
Conversation
Since commit 5cb1bff ("Remove day counter argument from spreaded curves"), ZeroSpreadedTermStructure ignores any day counter it is given and always delegates to the underlying curve's day counter. However, the higher-level APIs that build that structure internally still exposed a DayCounter parameter that had become a no-op: - CashFlows::npv() (z-spread overload) - CashFlows::zSpread() - BondFunctions::cleanPrice() (z-spread overload) - BondFunctions::dirtyPrice() (z-spread overload) - BondFunctions::zSpread() Add new primary overloads without the DayCounter argument and mark the old signatures [[deprecated]] ("Deprecated in version 1.42"), following the same pattern used in 5cb1bff for ZeroSpreadedTermStructure itself. The deprecated overloads are one-line delegates to the new primaries. Update all internal callers in test-suite/bonds.cpp and test-suite/assetswap.cpp to use the new overloads. Remove the stale "to be fixed" comment in zerospreadedtermstructure.hpp. Fixes lballabio#2278.
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.
Since commit 5cb1bff ("Remove day counter argument from spreaded
curves"),
ZeroSpreadedTermStructureignores the day counter it isgiven and always delegates to the underlying curve's. However, the
higher-level APIs still exposed a
DayCounterparameter that hadsilently become a no-op:
CashFlows::npv()(z-spread overload)CashFlows::zSpread()BondFunctions::cleanPrice(),dirtyPrice(),zSpread()(z-spread overloads)This adds new primary overloads without the
DayCounterargument andmarks the old signatures
[[deprecated]](version 1.42), following thesame pattern used in 5cb1bff for
ZeroSpreadedTermStructureitself.Internal callers in the test suite are updated accordingly.
Fixes #2278.