diff --git a/ql/experimental/commodities/commodityindex.cpp b/ql/experimental/commodities/commodityindex.cpp index 06b1f11a75..1fe3ed397b 100644 --- a/ql/experimental/commodities/commodityindex.cpp +++ b/ql/experimental/commodities/commodityindex.cpp @@ -23,7 +23,7 @@ namespace QuantLib { - CommodityIndex::CommodityIndex(const std::string& indexName, + CommodityIndex::CommodityIndex(std::string indexName, CommodityType commodityType, Currency currency, UnitOfMeasure unitOfMeasure, @@ -32,7 +32,7 @@ namespace QuantLib { ext::shared_ptr forwardCurve, ext::shared_ptr exchangeContracts, int nearbyOffset) - : name_(indexName), commodityType_(std::move(commodityType)), + : name_(std::move(indexName)), commodityType_(std::move(commodityType)), unitOfMeasure_(std::move(unitOfMeasure)), currency_(std::move(currency)), calendar_(std::move(calendar)), lotQuantity_(lotQuantity), forwardCurve_(std::move(forwardCurve)), exchangeContracts_(std::move(exchangeContracts)), diff --git a/ql/experimental/commodities/commodityindex.hpp b/ql/experimental/commodities/commodityindex.hpp index 31876eca5d..54717230f3 100644 --- a/ql/experimental/commodities/commodityindex.hpp +++ b/ql/experimental/commodities/commodityindex.hpp @@ -34,7 +34,7 @@ namespace QuantLib { //! base class for commodity indexes class CommodityIndex : public Index { public: - CommodityIndex(const std::string& name, + CommodityIndex(std::string name, CommodityType commodityType, Currency currency, UnitOfMeasure unitOfMeasure,