Login  Register

QuEP 4: Reducing abstraction penalty by means of disposable arrays

Posted by DU VIGNAUD François on May 17, 2006; 1:42am
URL: http://quantlib.414.s1.nabble.com/QuEP-4-Reducing-abstraction-penalty-by-means-of-disposable-arrays-tp11132.html

 

Hi all,

 

I have found something that seems to be a bug in the disposable Disposable Class Template. Indeed, the following constructor destroys the non disposable object t given as argument: (<a href="mk:@MSITStore:C:\Program%20Files\Quantlib\QuantLib-0.3.12\Docs\QuantLib_cpp-3.12.chm::/disposable_8hpp-source.html">ql/Utilities/disposable.hpp line 74 to 77)

    template <class T>

    inline Disposable<T>::Disposable(T& t) {

        this->swap(t);

    }

 

To my point of view this behaviour is not consistent with the original Luigi’s proposal. By the way, this “bug” is corrected in the code excerpts featured in the QuEP9.

 

Best regards,

 

François