From cc755cdf53458a29d59b8b81d3eb14cebbd2221a Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Tue, 12 Apr 2022 21:45:37 +0200 Subject: [PATCH] Removed usage of auto_ptr macros and relative configure flag --- .github/workflows/linux-full-tests.yml | 7 ------ .github/workflows/linux.yml | 8 ------ CMakeLists.txt | 2 -- Docs/pages/config.docs | 6 ----- cmake/GenerateHeaders.cmake | 1 + configure.ac | 19 +------------- ql/Makefile.am | 1 + ql/auto_ptr.hpp | 21 ++++++---------- ql/config.hpp.cfg | 1 - ql/experimental/variancegamma/fftengine.hpp | 18 ++++++------- .../variancegamma/fftvanillaengine.cpp | 6 ++--- .../variancegamma/fftvanillaengine.hpp | 12 +++------ .../variancegamma/fftvariancegammaengine.cpp | 6 ++--- .../variancegamma/fftvariancegammaengine.hpp | 12 +++------ .../operators/ninepointlinearop.hpp | 12 --------- .../operators/triplebandlinearop.hpp | 9 ------- ql/methods/montecarlo/exercisestrategy.hpp | 4 --- .../longstaffschwartzpathpricer.hpp | 8 ------ .../bermudanswaptionexercisevalue.cpp | 6 ++--- .../bermudanswaptionexercisevalue.hpp | 4 --- .../callability/exercisevalue.hpp | 7 +----- .../marketmodels/callability/lsstrategy.cpp | 6 ++--- .../marketmodels/callability/lsstrategy.hpp | 4 --- .../callability/marketmodelbasissystem.hpp | 4 --- .../marketmodelparametricexercise.hpp | 4 --- .../callability/nothingexercisevalue.cpp | 6 ++--- .../callability/nothingexercisevalue.hpp | 4 --- .../callability/parametricexerciseadapter.cpp | 7 ++---- .../callability/parametricexerciseadapter.hpp | 4 --- .../callability/swapbasissystem.cpp | 6 ++--- .../callability/swapbasissystem.hpp | 4 --- .../callability/swapforwardbasissystem.cpp | 9 ++----- .../callability/swapforwardbasissystem.hpp | 4 --- .../callability/swapratetrigger.cpp | 6 ++--- .../callability/swapratetrigger.hpp | 4 --- .../callability/triggeredswapexercise.cpp | 6 ++--- .../callability/triggeredswapexercise.hpp | 4 --- .../callability/upperboundengine.cpp | 6 ++--- ql/models/marketmodels/curvestate.hpp | 4 --- .../curvestates/cmswapcurvestate.cpp | 5 ++-- .../curvestates/cmswapcurvestate.hpp | 4 --- .../curvestates/coterminalswapcurvestate.cpp | 6 ++--- .../curvestates/coterminalswapcurvestate.hpp | 4 --- .../curvestates/lmmcurvestate.cpp | 5 ++-- .../curvestates/lmmcurvestate.hpp | 4 --- ql/models/marketmodels/multiproduct.hpp | 4 --- .../marketmodels/pathwisemultiproduct.hpp | 4 --- .../products/multiproductcomposite.cpp | 6 ++--- .../products/multiproductcomposite.hpp | 4 --- .../multistep/callspecifiedmultiproduct.cpp | 6 ++--- .../multistep/callspecifiedmultiproduct.hpp | 4 --- .../products/multistep/cashrebate.cpp | 6 ++--- .../products/multistep/cashrebate.hpp | 4 --- .../products/multistep/exerciseadapter.cpp | 6 ++--- .../products/multistep/exerciseadapter.hpp | 4 --- .../multistep/multistepcoinitialswaps.cpp | 6 ++--- .../multistep/multistepcoinitialswaps.hpp | 4 --- .../multistep/multistepcoterminalswaps.cpp | 6 ++--- .../multistep/multistepcoterminalswaps.hpp | 4 --- .../multistepcoterminalswaptions.cpp | 6 ++--- .../multistepcoterminalswaptions.hpp | 4 --- .../products/multistep/multistepforwards.cpp | 6 ++--- .../products/multistep/multistepforwards.hpp | 4 --- .../multistep/multistepinversefloater.cpp | 6 ++--- .../multistep/multistepinversefloater.hpp | 4 --- .../products/multistep/multistepnothing.cpp | 6 ++--- .../products/multistep/multistepnothing.hpp | 4 --- .../multistep/multistepoptionlets.cpp | 6 ++--- .../multistep/multistepoptionlets.hpp | 4 --- .../multistep/multisteppathwisewrapper.cpp | 6 ++--- .../multistep/multisteppathwisewrapper.hpp | 4 --- .../multistepperiodcapletswaptions.cpp | 6 ++--- .../multistepperiodcapletswaptions.hpp | 4 --- .../products/multistep/multistepratchet.cpp | 6 ++--- .../products/multistep/multistepratchet.hpp | 4 --- .../products/multistep/multistepswap.cpp | 6 ++--- .../products/multistep/multistepswap.hpp | 4 --- .../products/multistep/multistepswaption.cpp | 6 ++--- .../products/multistep/multistepswaption.hpp | 4 --- .../products/multistep/multisteptarn.cpp | 6 ++--- .../products/multistep/multisteptarn.hpp | 4 --- .../onestep/onestepcoinitialswaps.cpp | 6 ++--- .../onestep/onestepcoinitialswaps.hpp | 4 --- .../onestep/onestepcoterminalswaps.cpp | 6 ++--- .../onestep/onestepcoterminalswaps.hpp | 4 --- .../products/onestep/onestepforwards.cpp | 6 ++--- .../products/onestep/onestepforwards.hpp | 4 --- .../products/onestep/onestepoptionlets.cpp | 6 ++--- .../products/onestep/onestepoptionlets.hpp | 4 --- .../pathwise/pathwiseproductcallspecified.cpp | 6 ++--- .../pathwise/pathwiseproductcallspecified.hpp | 4 --- .../pathwise/pathwiseproductcaplet.cpp | 16 +++++------- .../pathwise/pathwiseproductcaplet.hpp | 12 --------- .../pathwise/pathwiseproductcashrebate.cpp | 6 ++--- .../pathwise/pathwiseproductcashrebate.hpp | 4 --- .../pathwiseproductinversefloater.cpp | 6 ++--- .../pathwiseproductinversefloater.hpp | 4 --- .../products/pathwise/pathwiseproductswap.cpp | 6 ++--- .../products/pathwise/pathwiseproductswap.hpp | 4 --- .../pathwise/pathwiseproductswaption.cpp | 10 +++----- .../pathwise/pathwiseproductswaption.hpp | 8 ------ .../products/singleproductcomposite.cpp | 6 ++--- .../products/singleproductcomposite.hpp | 4 --- ql/qldefines.hpp | 6 +++++ ql/quantlib.hpp | 1 - .../yield/fittedbonddiscountcurve.hpp | 4 --- .../yield/nonlinearfittingmethods.cpp | 25 +++++++++---------- .../yield/nonlinearfittingmethods.hpp | 24 ------------------ ql/userconfig.hpp | 5 ---- ql/utilities/clone.hpp | 17 ------------- test-suite/marketmodel.cpp | 1 - 111 files changed, 135 insertions(+), 552 deletions(-) diff --git a/.github/workflows/linux-full-tests.yml b/.github/workflows/linux-full-tests.yml index 162f6288370..741b9a76b65 100644 --- a/.github/workflows/linux-full-tests.yml +++ b/.github/workflows/linux-full-tests.yml @@ -140,13 +140,6 @@ jobs: cc: gcc cxx: g++ configureflags: --enable-std-classes - - name: "auto_ptr re-enabled" - shortname: autoptr - tag: rolling - cc: gcc - cxx: g++ - cxxflags: "-Wno-deprecated-declarations" - configureflags: --disable-std-unique-ptr - name: "Thread-safe observer enabled" shortname: threadsafe tag: rolling diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5505dea78bf..c7bbcae4208 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -145,14 +145,6 @@ jobs: cxx: g++ configureflags: --enable-std-classes tests: true - - name: "auto_ptr re-enabled" - shortname: autoptr - tag: rolling - cc: gcc - cxx: g++ - cxxflags: "-Wno-deprecated-declarations" - configureflags: --disable-std-unique-ptr - tests: true - name: "Thread-safe observer enabled" shortname: threadsafe tag: rolling diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d368d27483..7316656628c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,14 +60,12 @@ option(QL_USE_CLANG_TIDY "Use clang-tidy when building" OFF) option(QL_USE_INDEXED_COUPON "Use indexed coupons instead of par coupons" OFF) option(QL_USE_STD_CLASSES "Enable all QL_USE_STD_ options" OFF) option(QL_USE_STD_SHARED_PTR "Use standard smart pointers instead of Boost ones" OFF) -option(QL_USE_STD_UNIQUE_PTR "Use std::unique_ptr instead of std::auto_ptr" ON) option(QL_USE_STD_FUNCTION "Use std::function and std::bind instead of Boost ones" OFF) option(QL_USE_STD_TUPLE "Use std::tuple instead of boost::tuple" OFF) # Convenience option to activate all STD options if (QL_USE_STD_CLASSES) set(QL_USE_STD_SHARED_PTR ON) - set(QL_USE_STD_UNIQUE_PTR ON) set(QL_USE_STD_FUNCTION ON) set(QL_USE_STD_TUPLE ON) endif() diff --git a/Docs/pages/config.docs b/Docs/pages/config.docs index 4fa8a3f4063..4cc7fe7bb96 100644 --- a/Docs/pages/config.docs +++ b/Docs/pages/config.docs @@ -113,12 +113,6 @@ default) the Boost facilities are used. Note that `std::shared_ptr` does not check access and can cause segmentation faults. - \code - #define QL_USE_STD_UNIQUE_PTR - \endcode - If defined (the default), `std::unique_ptr` is - used instead of `std::auto_ptr`. If disabled, `std::auto_ptr` is used. - \code #define QL_USE_STD_FUNCTION \endcode diff --git a/cmake/GenerateHeaders.cmake b/cmake/GenerateHeaders.cmake index b25f7e8ce51..40067bb2792 100644 --- a/cmake/GenerateHeaders.cmake +++ b/cmake/GenerateHeaders.cmake @@ -11,6 +11,7 @@ function(generate_ql_header source_dir binary_dir) "#endif\n\n") file(GLOB children_hpp RELATIVE ${source_dir} "${source_dir}/ql/*.hpp") list(FILTER children_hpp EXCLUDE REGEX "auto_link.hpp") + list(FILTER children_hpp EXCLUDE REGEX "auto_ptr.hpp") list(FILTER children_hpp EXCLUDE REGEX "config.*.hpp") list(FILTER children_hpp EXCLUDE REGEX "mathconstants.hpp") list(FILTER children_hpp EXCLUDE REGEX "qldefines.hpp") diff --git a/configure.ac b/configure.ac index bd1c3884b43..cf84fedf288 100644 --- a/configure.ac +++ b/configure.ac @@ -376,20 +376,6 @@ if test "$ql_use_std_pointers" = "yes" ; then fi AC_MSG_RESULT([$ql_use_std_pointers]) -AC_MSG_CHECKING([whether to enable std::unique_ptr instead of std::auto_ptr]) -AC_ARG_ENABLE([std-unique-ptr], - AS_HELP_STRING([--enable-std-unique-ptr], - [If enabled (the default), std::unique_ptr will - be used instead of the deprecated std::auto_ptr. - If disabled, std::auto_ptr will still be used.]), - [ql_use_unique_ptr=$enableval], - [ql_use_unique_ptr=yes]) -if test "$ql_use_unique_ptr" = "yes" ; then - AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], - [Define this if you want to replace std::auto_ptr with std::unique_ptr.]) -fi -AC_MSG_RESULT([$ql_use_unique_ptr]) - AC_MSG_CHECKING([whether to enable std::function]) AC_ARG_ENABLE([std-function], AS_HELP_STRING([--enable-std-function], @@ -425,8 +411,7 @@ AC_MSG_CHECKING([whether to enable available std classes]) AC_ARG_ENABLE([std-classes], AS_HELP_STRING([--enable-std-classes], [This is a shortcut for --enable-std-pointers - --enable-std-unique-ptr --enable-std-function - --enable-std-tuple. + --enable-std-function --enable-std-tuple. If enabled, this supersedes any --disable option passed for the above.]), [ql_use_std_classes=$enableval], @@ -434,8 +419,6 @@ AC_ARG_ENABLE([std-classes], if test "$ql_use_std_classes" = "yes" ; then AC_DEFINE([QL_USE_STD_SHARED_PTR],[1], [Define this if you want to use standard smart pointers.]) - AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], - [Define this if you want to replace std::auto_ptr with std::unique_ptr.]) AC_DEFINE([QL_USE_STD_FUNCTION],[1], [Define this if you want to use std::function and std::bind.]) AC_DEFINE([QL_USE_STD_TUPLE],[1], diff --git a/ql/Makefile.am b/ql/Makefile.am index 710a1b6f3d3..976dd514283 100644 --- a/ql/Makefile.am +++ b/ql/Makefile.am @@ -149,6 +149,7 @@ quantlib.hpp: Makefile.am for i in $(this_include_HEADERS); do \ case $$i in \ auto_link.hpp) continue;; \ + auto_ptr.hpp) continue;; \ config.hpp) continue;; \ mathconstants.hpp) continue;; \ qldefines.hpp) continue;; \ diff --git a/ql/auto_ptr.hpp b/ql/auto_ptr.hpp index 4fff6ff0bd1..a024b7cc9d4 100644 --- a/ql/auto_ptr.hpp +++ b/ql/auto_ptr.hpp @@ -17,24 +17,19 @@ FOR A PARTICULAR PURPOSE. See the license for more details. */ -/*! \file auto_ptr.hpp - \brief Facilities to switch from auto_ptr to unique_ptr -*/ - #ifndef quantlib_auto_ptr_hpp #define quantlib_auto_ptr_hpp #include -#if defined(QL_USE_STD_UNIQUE_PTR) -# define QL_UNIQUE_OR_AUTO_PTR std::unique_ptr -#else -# pragma message("Warning: using auto_ptr in QuantLib is now deprecated.") -# pragma message(" If you're using --disable-std-unique-ptr in your build") -# pragma message(" or if you undefined QL_USE_STD_UNIQUE_PTR in ql/userconfig.hpp,") -# pragma message(" please restore the default compilation options in the near future.") -# define QL_UNIQUE_OR_AUTO_PTR std::auto_ptr -#endif +#pragma message("Warning: the deprecated QL_UNIQUE_OR_AUTO_PTR macro is no longer used. Replace it with std::unique_ptr.") +#pragma message(" For the time being, the QL_USE_STD_UNIQUE_PTR macro is set to 1. However, do not check for it, since it will disappear in a future release.") +#pragma message(" This file will also disappear in a future release; do not include it.") + +/*! \deprecated Use std::unique_ptr instead. + Deprecated in version 1.27 +*/ +#define QL_UNIQUE_OR_AUTO_PTR std::unique_ptr #endif diff --git a/ql/config.hpp.cfg b/ql/config.hpp.cfg index 1a61f1fa98b..25b3bd6129b 100644 --- a/ql/config.hpp.cfg +++ b/ql/config.hpp.cfg @@ -38,7 +38,6 @@ #cmakedefine QL_HIGH_RESOLUTION_DATE #cmakedefine QL_USE_INDEXED_COUPON #cmakedefine QL_USE_STD_SHARED_PTR -#cmakedefine QL_USE_STD_UNIQUE_PTR #cmakedefine QL_USE_STD_FUNCTION #cmakedefine QL_USE_STD_TUPLE diff --git a/ql/experimental/variancegamma/fftengine.hpp b/ql/experimental/variancegamma/fftengine.hpp index 8c704876c6b..10f2d7c9531 100644 --- a/ql/experimental/variancegamma/fftengine.hpp +++ b/ql/experimental/variancegamma/fftengine.hpp @@ -46,18 +46,14 @@ namespace QuantLib { class FFTEngine : public VanillaOption::engine { - public: - FFTEngine(ext::shared_ptr process, Real logStrikeSpacing); - void calculate() const override; - void update() override; + public: + FFTEngine(ext::shared_ptr process, Real logStrikeSpacing); + void calculate() const override; + void update() override; - void precalculate(const std::vector >& optionList); - #if defined(QL_USE_STD_UNIQUE_PTR) + void precalculate(const std::vector >& optionList); virtual std::unique_ptr clone() const = 0; - #else - virtual std::auto_ptr clone() const = 0; - #endif - protected: + protected: virtual void precalculateExpiry(Date d) = 0; virtual std::complex complexFourierTransform(std::complex u) const = 0; virtual Real discountFactor(Date d) const = 0; @@ -68,7 +64,7 @@ namespace QuantLib { ext::shared_ptr process_; Real lambda_; // Log strike spacing - private: + private: typedef std::map, Real> PayoffResultMap; typedef std::map ResultMap; ResultMap resultMap_; diff --git a/ql/experimental/variancegamma/fftvanillaengine.cpp b/ql/experimental/variancegamma/fftvanillaengine.cpp index f6d7e7c45b0..6a72fac8656 100644 --- a/ql/experimental/variancegamma/fftvanillaengine.cpp +++ b/ql/experimental/variancegamma/fftvanillaengine.cpp @@ -20,7 +20,6 @@ FOR A PARTICULAR PURPOSE. See the license for more details. #include #include #include -#include #include namespace QuantLib { @@ -31,12 +30,11 @@ namespace QuantLib { { } - QL_UNIQUE_OR_AUTO_PTR FFTVanillaEngine::clone() const + std::unique_ptr FFTVanillaEngine::clone() const { ext::shared_ptr process = ext::dynamic_pointer_cast(process_); - return QL_UNIQUE_OR_AUTO_PTR( - new FFTVanillaEngine(process, lambda_)); + return std::unique_ptr(new FFTVanillaEngine(process, lambda_)); } void FFTVanillaEngine::precalculateExpiry(Date d) diff --git a/ql/experimental/variancegamma/fftvanillaengine.hpp b/ql/experimental/variancegamma/fftvanillaengine.hpp index d748f0883fa..6106aeae03c 100644 --- a/ql/experimental/variancegamma/fftvanillaengine.hpp +++ b/ql/experimental/variancegamma/fftvanillaengine.hpp @@ -40,16 +40,12 @@ namespace QuantLib { explicit FFTVanillaEngine( const ext::shared_ptr&process, Real logStrikeSpacing = 0.001); - #if defined(QL_USE_STD_UNIQUE_PTR) std::unique_ptr clone() const override; -#else - virtual std::auto_ptr clone() const; - #endif protected: - void precalculateExpiry(Date d) override; - std::complex complexFourierTransform(std::complex u) const override; - Real discountFactor(Date d) const override; - Real dividendYield(Date d) const override; + void precalculateExpiry(Date d) override; + std::complex complexFourierTransform(std::complex u) const override; + Real discountFactor(Date d) const override; + Real dividendYield(Date d) const override; private: DiscountFactor dividendDiscount_; diff --git a/ql/experimental/variancegamma/fftvariancegammaengine.cpp b/ql/experimental/variancegamma/fftvariancegammaengine.cpp index 0c3fae633a2..0e6ec8f140a 100644 --- a/ql/experimental/variancegamma/fftvariancegammaengine.cpp +++ b/ql/experimental/variancegamma/fftvariancegammaengine.cpp @@ -19,7 +19,6 @@ FOR A PARTICULAR PURPOSE. See the license for more details. #include #include -#include #include namespace QuantLib { @@ -30,12 +29,11 @@ namespace QuantLib { { } - QL_UNIQUE_OR_AUTO_PTR FFTVarianceGammaEngine::clone() const + std::unique_ptr FFTVarianceGammaEngine::clone() const { ext::shared_ptr process = ext::dynamic_pointer_cast(process_); - return QL_UNIQUE_OR_AUTO_PTR( - new FFTVarianceGammaEngine(process, lambda_)); + return std::unique_ptr(new FFTVarianceGammaEngine(process, lambda_)); } void FFTVarianceGammaEngine::precalculateExpiry(Date d) diff --git a/ql/experimental/variancegamma/fftvariancegammaengine.hpp b/ql/experimental/variancegamma/fftvariancegammaengine.hpp index 32b86fbe60e..82dc6a66ad6 100644 --- a/ql/experimental/variancegamma/fftvariancegammaengine.hpp +++ b/ql/experimental/variancegamma/fftvariancegammaengine.hpp @@ -40,16 +40,12 @@ namespace QuantLib { explicit FFTVarianceGammaEngine( const ext::shared_ptr&process, Real logStrikeSpacing = 0.001); - #if defined(QL_USE_STD_UNIQUE_PTR) std::unique_ptr clone() const override; -#else - virtual std::auto_ptr clone() const; - #endif protected: - void precalculateExpiry(Date d) override; - std::complex complexFourierTransform(std::complex u) const override; - Real discountFactor(Date d) const override; - Real dividendYield(Date d) const override; + void precalculateExpiry(Date d) override; + std::complex complexFourierTransform(std::complex u) const override; + Real discountFactor(Date d) const override; + Real dividendYield(Date d) const override; private: DiscountFactor dividendDiscount_; diff --git a/ql/methods/finitedifferences/operators/ninepointlinearop.hpp b/ql/methods/finitedifferences/operators/ninepointlinearop.hpp index 82335c66770..1e4bd6efaa2 100644 --- a/ql/methods/finitedifferences/operators/ninepointlinearop.hpp +++ b/ql/methods/finitedifferences/operators/ninepointlinearop.hpp @@ -28,9 +28,6 @@ #include #include -#if !defined(QL_USE_STD_UNIQUE_PTR) -#include -#endif #include namespace QuantLib { @@ -57,21 +54,12 @@ namespace QuantLib { NinePointLinearOp() = default; Size d0_, d1_; - #if !defined(QL_USE_STD_UNIQUE_PTR) - boost::shared_array i00_, i10_, i20_; - boost::shared_array i01_, i21_; - boost::shared_array i02_, i12_, i22_; - boost::shared_array a00_, a10_, a20_; - boost::shared_array a01_, a11_, a21_; - boost::shared_array a02_, a12_, a22_; - #else std::unique_ptr i00_, i10_, i20_; std::unique_ptr i01_, i21_; std::unique_ptr i02_, i12_, i22_; std::unique_ptr a00_, a10_, a20_; std::unique_ptr a01_, a11_, a21_; std::unique_ptr a02_, a12_, a22_; - #endif ext::shared_ptr mesher_; }; diff --git a/ql/methods/finitedifferences/operators/triplebandlinearop.hpp b/ql/methods/finitedifferences/operators/triplebandlinearop.hpp index 8812fe693e2..45da9877663 100644 --- a/ql/methods/finitedifferences/operators/triplebandlinearop.hpp +++ b/ql/methods/finitedifferences/operators/triplebandlinearop.hpp @@ -28,9 +28,6 @@ #define quantlib_triple_band_linear_op_hpp #include -#if !defined(QL_USE_STD_UNIQUE_PTR) -#include -#endif #include namespace QuantLib { @@ -69,15 +66,9 @@ namespace QuantLib { TripleBandLinearOp() = default; Size direction_; - #if !defined(QL_USE_STD_UNIQUE_PTR) - boost::shared_array i0_, i2_; - boost::shared_array reverseIndex_; - boost::shared_array lower_, diag_, upper_; - #else std::unique_ptr i0_, i2_; std::unique_ptr reverseIndex_; std::unique_ptr lower_, diag_, upper_; - #endif ext::shared_ptr mesher_; }; diff --git a/ql/methods/montecarlo/exercisestrategy.hpp b/ql/methods/montecarlo/exercisestrategy.hpp index f125024823d..53019357716 100644 --- a/ql/methods/montecarlo/exercisestrategy.hpp +++ b/ql/methods/montecarlo/exercisestrategy.hpp @@ -36,11 +36,7 @@ namespace QuantLib { virtual void reset() = 0; virtual bool exercise(const State& currentState) const = 0; virtual void nextStep(const State& currentState) = 0; - #if defined(QL_USE_STD_UNIQUE_PTR) virtual std::unique_ptr > clone() const = 0; - #else - virtual std::auto_ptr > clone() const = 0; - #endif }; } diff --git a/ql/methods/montecarlo/longstaffschwartzpathpricer.hpp b/ql/methods/montecarlo/longstaffschwartzpathpricer.hpp index 7ec6084f005..a5c4f41e2cd 100644 --- a/ql/methods/montecarlo/longstaffschwartzpathpricer.hpp +++ b/ql/methods/montecarlo/longstaffschwartzpathpricer.hpp @@ -33,9 +33,6 @@ #include #include #include -#if !defined(QL_USE_STD_UNIQUE_PTR) -#include -#endif #include #include @@ -78,13 +75,8 @@ namespace QuantLib { mutable QuantLib::IncrementalStatistics exerciseProbability_; - #if defined(QL_USE_STD_UNIQUE_PTR) std::unique_ptr coeff_; std::unique_ptr dF_; - #else - boost::scoped_array coeff_; - boost::scoped_array dF_; - #endif mutable std::vector paths_; const std::vector > v_; diff --git a/ql/models/marketmodels/callability/bermudanswaptionexercisevalue.cpp b/ql/models/marketmodels/callability/bermudanswaptionexercisevalue.cpp index 1e769b14e1f..7234716f4ec 100644 --- a/ql/models/marketmodels/callability/bermudanswaptionexercisevalue.cpp +++ b/ql/models/marketmodels/callability/bermudanswaptionexercisevalue.cpp @@ -17,7 +17,6 @@ FOR A PARTICULAR PURPOSE. See the license for more details. */ -#include #include #include #include @@ -79,10 +78,9 @@ namespace QuantLib { return cf_; } - QL_UNIQUE_OR_AUTO_PTR + std::unique_ptr BermudanSwaptionExerciseValue::clone() const { - return QL_UNIQUE_OR_AUTO_PTR( - new BermudanSwaptionExerciseValue(*this)); + return std::unique_ptr(new BermudanSwaptionExerciseValue(*this)); } } diff --git a/ql/models/marketmodels/callability/bermudanswaptionexercisevalue.hpp b/ql/models/marketmodels/callability/bermudanswaptionexercisevalue.hpp index bcd5e34f532..04965c19e42 100644 --- a/ql/models/marketmodels/callability/bermudanswaptionexercisevalue.hpp +++ b/ql/models/marketmodels/callability/bermudanswaptionexercisevalue.hpp @@ -43,11 +43,7 @@ namespace QuantLib { // whether or not evolution times are exercise times std::valarray isExerciseTime() const override; MarketModelMultiProduct::CashFlow value(const CurveState&) const override; -#if defined(QL_USE_STD_UNIQUE_PTR) std::unique_ptr clone() const override; -#else - std::auto_ptr clone() const; - #endif private: Size numberOfExercises_; std::vector