Re: static_casting from Parent to Child??

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: static_casting from Parent to Child??

Jonathan Wakely-4
On 1 June 2015 at 18:25, ArbolOne wrote:
> In the bellow sample I get an error saying : cannot convert from
> 'std::shared_ptr<Parent>' to 'Child'

This is not a GCC question, it's a general C++ question, so is off-topic here.


Of course you can't convert shared_ptr<Parent> to Child, they are
totally unrelated. You can't even convert Parent* to Child, one is a
pointer and one is not.

Maybe you mean static_pointer_cast<Child>(e) which converts
pointer-to-Parent to pointer-to-Child.

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe