Boost logo

Boost :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2002-04-19 12:19:11


"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:006d01c1e7ab$18eccac0$1d00a8c0_at_pdimov2...
> From: "Phil Nash" <phil.nash.lists_at_[hidden]>
> > Certainly I am in violent agreement that smart_resource like
capabilities
> > should be made available somewhere (so SmartPtr capabilities applied to
> non
> > pointers).
>
> Take a look:
>

> class shared_handle
> {
> public:
>
> explicit shared_handle(HANDLE h): h_(h), c_(h, CloseHandle)
> {
> }
>
> HANDLE get() const
> {
> return h_;
> }
>
> private:
>
> HANDLE h_;
> boost::detail::shared_count c_;
> };
>

Compare this interface with one that policy-based smart_ptr one would
present. And if I need scope_ptr on the HANLE do I need another class?

Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk