|
Boost Users : |
From: bjorn.karlsson_at_[hidden]
Date: 2003-02-14 08:00:19
> From: Peter Dimov [mailto:pdimov_at_[hidden]]
[snip]
> A zero-overhead scoped_ptr<X, D> would require a helper class here:
Yes, and I shouldn't have said scoped_ptr<X,D>, but scoped_ptr<X> with
custom deallocation capabilities... I'd be willing to pay for the increase
in size, but I realize not everyone would. The case is real, however.
> scoped_ptr<void, void (*) (void *)> p(hPrinter, &ClosePrinter);
>
> that would increase sizeof(scoped_ptr) and is of questionable
> utility. :-)
Actually, I kind of like it. :-)
> There is always the option to define a dedicated printer
> class, of course.
Yep, but there are hundreds of cases like this, which is why the feature
would be useful. One could argue the same for the resource management of any
type, right? ;-)
Bjorn Karlsson
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net