Bug in intrusive_ptr,scoped_ptr,scoped_array

Hello, at least with VS2005 there is a bug in the three smart pointers... If you want to check if the pointer is empty (with unspecified bool) then you get also with NULL a true back. For this the following fix should work: #if defined( _MANAGED ) static void unspecified_bool( this_type*** ) { } typedef void (*unspecified_bool_type)( this_type*** ); operator unspecified_bool_type() const // never throws { return px == 0? 0: unspecified_bool; } #else .... #endif Best regards Hansjörg

Mathias Gaunard schrieb:
Hansi wrote:
at least with VS2005 there is a bug in the three smart pointers... [...]
For this the following fix should work:
#if defined( _MANAGED )
I'm not sure this is a supported target. Is it?
shared_ptr has the bugfix...a lot of people here uses vs2005 with mixed mode (some unmanaged and some managed stuff)programming...
participants (2)
-
Hansi
-
Mathias Gaunard