Boost logo

Boost :

From: Vugts, Robert (robert.vugts_at_[hidden])
Date: 2000-12-22 05:59:52


But your example contained a shared_ptr... (see below)

I agree that scoped_ptr::release would be useful.

Rob Vugts

----------------------------
[Original message from Joe Gottman]

    I think the scoped_ptr class should have a release() function, similar
    to the one in std::auto_ptr. This would help in cases like the
following

    int *foo() {
        shared_ptr<int> the_pointer(new int());
        //Do stuff that might throw
        return the_pointer.release();
    }

-----Original Message-----
From: Joe Gottman [mailto:joegottman_at_[hidden]]
Sent: 22 December 2000 02:26
To: boost_at_[hidden]
Subject: Re: [boost] Suggestion: scoped_ptr::release()

As the one who originally made the suggestion, I would like to point out
that my original suggestion was that scoped_ptr, not shared_ptr, be given a
release() method. Since a scoped_ptr has exclusive ownership of the object
it points to, it becomes much easier to implement the release() method.

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify the
sender. You must not, directly or indirectly, use, disclose, distribute,
print, or copy any part of this message if you are not the intended
recipient. CREDIT SUISSE GROUP and each of its subsidiaries each reserve
the right to monitor all e-mail communications through its networks. Any
views expressed in this message are those of the individual sender, except
where the message states otherwise and the sender is authorised to state
them to be the views of any such entity.
Unless otherwise stated, any pricing information given in this message is
indicative only, is subject to change and does not constitute an offer to
deal at any price quoted.
Any reference to the terms of executed transactions should be treated as
preliminary only and subject to our formal written confirmation.


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