
Why isn't there a version of boost::scoped_ptr<T> that takes a deleter? That is, why isn't there scoped_ptr<T, D> ? It would be useful to me. Robert Ramey

"Robert Ramey" <ramey@rrsd.com> wrote in message news:20040603203108.C208831594@acme.west.net... | Why isn't there a version of boost::scoped_ptr<T> that takes a deleter? | | That is, why isn't there scoped_ptr<T, D> ? | | It would be useful to me. So would auto_ptr<T,D> in some of my code. In particular, auto_ptr<T,D&>. br Thorsten

Thorsten Ottosen wrote:
"Robert Ramey" <ramey@rrsd.com> wrote in message news:20040603203108.C208831594@acme.west.net... | Why isn't there a version of boost::scoped_ptr<T> that takes a deleter? | | That is, why isn't there scoped_ptr<T, D> ? | | It would be useful to me.
So would auto_ptr<T,D> in some of my code. In particular, auto_ptr<T,D&>.
Proposals to add features to scoped_ptr or scoped_array have been discussed in the past. Fortunately (for me), the bottom line has been to keep these objects light. If adding a deleter would require storing a pointer, then it increases its memory usage, and that makes it heavy. If you want to add features, you could create a variation of these classes, but I'll reiterate my request to keep the scoped_ classes light. (I don't care about auto_ptr at the moment.) -- Dick Hadsell 914-259-6320 Fax: 914-259-6499 Reply-to: hadsell@blueskystudios.com Blue Sky Studios http://www.blueskystudios.com 44 South Broadway, White Plains, NY 10601

"Richard Hadsell" <hadsell@blueskystudios.com> wrote in message news:40C093F9.2020900@blueskystudios.com... | Thorsten Ottosen wrote: | | >"Robert Ramey" <ramey@rrsd.com> wrote in message news:20040603203108.C208831594@acme.west.net... | >| Why isn't there a version of boost::scoped_ptr<T> that takes a deleter? | >| | >| That is, why isn't there scoped_ptr<T, D> ? | >| | >| It would be useful to me. | > | >So would auto_ptr<T,D> in some of my code. In particular, | >auto_ptr<T,D&>. | > | > | Proposals to add features to scoped_ptr or scoped_array have been | discussed in the past. Fortunately (for me), the bottom line has been | to keep these objects light. If adding a deleter would require storing | a pointer, then it increases its memory usage, and that makes it heavy. that's why a D& argument should be allowed. br Thorsten
participants (3)
-
Richard Hadsell
-
Robert Ramey
-
Thorsten Ottosen