Skip to content

Commit

Permalink
Deprecate the correct Currency::Data constructor (#2014)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Jul 8, 2024
2 parents c812b75 + a886fe7 commit 9e4ef24
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 6 deletions.
4 changes: 4 additions & 0 deletions ql/currencies/africa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

namespace QuantLib {

QL_DEPRECATED_DISABLE_WARNING

// Angolan kwanza
AOACurrency::AOACurrency() {
static ext::shared_ptr<Data> aoaData(
Expand Down Expand Up @@ -121,4 +123,6 @@ namespace QuantLib {
data_ = zmwData;
}

QL_DEPRECATED_ENABLE_WARNING

}
4 changes: 4 additions & 0 deletions ql/currencies/america.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

namespace QuantLib {

QL_DEPRECATED_DISABLE_WARNING

// Argentinian peso
/* The ISO three-letter code is ARS; the numeric code is 32.
It is divided in 100 centavos.
Expand Down Expand Up @@ -214,5 +216,7 @@ namespace QuantLib {
data_ = uyuData;
}

QL_DEPRECATED_ENABLE_WARNING

}

4 changes: 4 additions & 0 deletions ql/currencies/asia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

namespace QuantLib {

QL_DEPRECATED_DISABLE_WARNING

// Bangladesh taka
/* The ISO three-letter code is BDT; the numeric code is 50.
It is divided in 100 paisa.
Expand Down Expand Up @@ -344,5 +346,7 @@ namespace QuantLib {
data_ = lkrData;
}

QL_DEPRECATED_ENABLE_WARNING

}

5 changes: 5 additions & 0 deletions ql/currencies/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

namespace QuantLib {

QL_DEPRECATED_DISABLE_WARNING

// Bitcoin
/* https://bitcoin.org/
*/
Expand Down Expand Up @@ -121,5 +123,8 @@ namespace QuantLib {
"%3% %1$.5f"));
data_ = zecData;
}

QL_DEPRECATED_ENABLE_WARNING

}

6 changes: 5 additions & 1 deletion ql/currencies/europe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

namespace QuantLib {

QL_DEPRECATED_DISABLE_WARNING

// Bulgarian lev
/* The ISO three-letter code is BGL; the numeric code is 100.
It is divided in 100 stotinki.
Expand Down Expand Up @@ -552,6 +554,8 @@ namespace QuantLib {
new Data("Georgian lari", "GEL", 981, "GEL", "", 100, Rounding(), "1$.2F %3%"));
data_ = gelData;
}
}

QL_DEPRECATED_ENABLE_WARNING

}

4 changes: 4 additions & 0 deletions ql/currencies/oceania.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

namespace QuantLib {

QL_DEPRECATED_DISABLE_WARNING

// Australian dollar
/* The ISO three-letter code is AUD; the numeric code is 36.
It is divided into 100 cents.
Expand All @@ -52,4 +54,6 @@ namespace QuantLib {
data_ = nzdData;
}

QL_DEPRECATED_ENABLE_WARNING

}
13 changes: 8 additions & 5 deletions ql/currency.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,13 @@ namespace QuantLib {
Integer fractionsPerUnit;
Rounding rounding;
Currency triangulated;
QL_DEPRECATED
/*! \deprecated Do not use this data member.
Deprecated in version 1.33.
*/
[[deprecated("Do not use this data member")]]
std::string formatString;
std::set<std::string> minorUnitCodes;

/*! \deprecated Use the constructor without formatString.
Deprecated in version 1.33.
*/
QL_DEPRECATED
Data(std::string name,
std::string code,
Integer numericCode,
Expand All @@ -137,6 +136,10 @@ namespace QuantLib {
Currency triangulationCurrency = Currency(),
std::set<std::string> minorUnitCodes = {});

/*! \deprecated Use the constructor without formatString.
Deprecated in version 1.33.
*/
QL_DEPRECATED
Data(std::string name,
std::string code,
Integer numericCode,
Expand Down

0 comments on commit 9e4ef24

Please sign in to comment.