Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-04-02 18:04:44


At 12:08 PM 3/30/2001, Greg Colvin wrote:

>> > > Ah, wonderful. We should put this riff in boost/utility.hpp
>> > >
>> > > template <class T>
>> > > void delete_(T const volatile* x)
>> > > {
>> > > sizeof(T);
>> > > delete x;
>> > > }
>> > >
>> > > Then "delete x" becomes boost::delete_(x)
>> >
>> > Yes. Of course some compilers might complain about
>> > the apparently useless line, so perhaps
>> >
>> > if (sizeof(T))
>> > delete x;
>> >
>> > Regardless, a comment is in order.
>>
>> Good idea.

Even though I don't think it applies to scoped_ptr, I think it would be a
nice little addition to boost/utility.hpp.

But the name ought to be a bit more explicit, so that readers will know by
sight why it is used. delete_complete_type() or something.

Hum... Exactly when would you use it? Presumably mostly in
templates. How does a template know if the delete requires a complete
type?

--Beman


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