"David B. Held" <[EMAIL PROTECTED]> wrote in message
b1ehpj$j1n$[EMAIL PROTECTED]">news:b1ehpj$j1n$[EMAIL PROTECTED]...
> [...]
>     ~InitializerScopeGuard()
>     { if (execute_) storage::release(); }

Oops!

        ~InitializerScopeGuard()
        { if (execute_) storage_.release(); }

Also, I don't need the extra layer of indirection.  I could just
implement ref_counted directly, like so:

    template <typename U>
    ref_counted(std::auto_ptr<U>& p, InitializerScopeGuard guard)
      : count_(new unsigned(1))
    {
        guard.cancel();
        p.release();
    }

    smart_ptr(std::auto_ptr<U>& p)
        : storage(p), ownership(p, InitializerScopeGuard(*this)),
        checking(), conversion()
    { checking::on_init(p); }

Of course, the big question is whether it's valid to refer to 'this' for
a partially c'ted object, even if you only refer to the fully c'ted
portions.

Dave



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to