Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-05-06 14:10:22

At 11:42 AM 5/6/00 -0700, Dietmar Kuehl wrote:

>> >I assume you have a class directory_iterator which contains a
>> >boost::shared_ptr member. All you should have to do is write an
>> >out-of-line destructor for directory_iterator, which gets
>> >in a source (not a header) file.
>... and an assignment operator because the assignment operator might
>release the internal pointer, too.

Hum. Not so Cool:-(

> Anyway, thinking that a library
>should never produce a warning, not even if obscure warnings are
>on, this means for gcc to also implement the copy constructor (if
>-Weffc++ is turned on, the compiler warns for a class which defines
>a copy ctor, a copy assignment, or a dtor but not all three
>None of these methods is particularily complex: copy or a assigning
>pointer isn't that hard and the destrutor can even be empty. Still,
>would prefer to write no extra code at all: While it isn't the case
>the directory iterator, in general the out of line function
>isn't that nice because you need to write down all this template
>and such.
>> Cool! Why didn't I think of that?
>... but if everybody agrees that this is the way to go, I will take
>too. After all, C++ is quite verbose at times anyway.

Well, shared_ptr is ready to use now. If the need to write the
assignment operator (and cctor) was the only problem, maybe stick
with shared_ptr.


Boost list run by bdawes at, gregod at, cpdaniel at, john at