[C++-sig] wrapper & HeldType

Roman Yakovenko roman.yakovenko at gmail.com
Wed Oct 12 08:40:51 CEST 2005


On 10/11/05, Scott McKay <skottmckay at gmail.com> wrote:
> Have you tried
>
>  class_< data_wrapper, shared_ptr< data_wrapper > >(...);
>  implicitly_convertible< smart_ptr< data_wrapper >, smart_ptr< data > >();

smart_ptr is shared_ptr right?

>  That works for me.

It doesn't work fork me. I have compile time error saying that:

error C2440: 'initializing' : cannot convert from
'smart_pointers::data *' to 'data_wrapper *'
Cast from base to derived requires dynamic_cast or static_cast

I am using msvc 7.1

I do have solution, I just wanted to attract attention of boost.python
developers.

Any way, thanks for help.
>  S

Roman Yakovenko



More information about the Cplusplus-sig mailing list