adebaene@club-internet.fr wrote:
[color=blue]
> ReturnAPointer clearly returns a NULL smart pointer (px==0). The
> boolean operator for shared_ptr is :
>
> typedef T * this_type::*unspecified_bool_type;
> operator unspecified_bool_type() const // never throws
> {
> return px == 0? 0: &this_type::px;
> }
>
> Clearly, this operator should return an int** equal to 0, and indeed it
> does so in the native layer.[/color]
Well, it's actually an "int* boost::shared_ptr<int>::*" (e.g. a pointer
to boost::shared_ptr<int> member variable of type int*).
[color=blue]
> However, back in managed code, the return value of boolean operator -
> as shown by Visual 2005 - is 0xffffffff. Therefore, the WriteLine
> function is called, which, of course causes an assertion in
> shared_ptr::operator*.[/color]
This might be a problem with the handling of pointer to members. You
could try fiddling with the pointer-to-member related compiler switches.
Tom