Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2001-04-05 14:52:09


> This covers the (void*) casts, the only cast left is in
> template<typename Y>
> auto_ptr(auto_ptr<Y>& rhs) throw()
> : inherited((void *)((element_type *) rhs.release() ) )
> {}
> Isn't the (element_type*) cast dangerous?
Yes, and it isn't necessary for MSVC or gcc 2.95.2. (I'll cite bug for now)
So I've removed it in my copy.
(will repost to the vault shortly.)

> I don't see a corresponding templated constructor in auto_array_ptr (this
> is
> probably correct) but there is a templated assignment operator? Is this by
> design?
Ah, I suspect that the templated assignment operator should go. Because
while a Base * can point to a Derived *, the offsets for operator[] are
going to be wrong for a Base [] vs a Derived [].

> > Ok, I now understand the issue with exception safety. So let me just
> fully
> > understand the suggested solution. remove auto_ptr_ref?
> Hmm, better leave it as is, if the purpose of boost::auto_ptr is to
> provide
> an implementation of the standard auto_ptr where the compiler doesn't have
> one.
I'd be glad to have a "new and improved" auto_ptr but we should give it a
new name. Meantime I'm just trying for a auto_array_ptr. And since that
doesn't exist in std, I'm open to any and all "improvements"

In that light, are you suggesting that auto_array_ptr not use auto_ptr_ref?



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