Re: static_casting from Parent to Child??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux