Question about class Disposable

View: New views
2 Messages — Rating Filter:   Alert me  

Question about class Disposable

by Kim Kuen Tang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

what was the rationale to implement the class Disposable ?

And when should one use this class?

As I can see from the code:

template <class T>
inline Disposable<T>& Disposable<T>::operator=(const Disposable<T>& t) {
this->swap(const_cast<Disposable<T>&>(t));
return *this;
}

the user must supply a swap function to use the assign operator.
So the user can control what he/she wants to assign?



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
QuantLib-users mailing list
QuantLib-users@...
https://lists.sourceforge.net/lists/listinfo/quantlib-users

Re: Question about class Disposable

by Ferdinando Ametrano :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jun 13, 2008 at 11:24 PM, Kim Kuen tang <kuentang@...> wrote:
> what was the rationale to implement the class Disposable ?

http://quantlib.org/quep/quep009.html

ciao -- Nando

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
QuantLib-users mailing list
QuantLib-users@...
https://lists.sourceforge.net/lists/listinfo/quantlib-users
LightInTheBox - Buy quality products at wholesale price