Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Perlxs and C++ inheritance

by llancet (Friar)
on Apr 24, 2014 at 09:13 UTC ( [id://1083547]=note: print w/replies, xml ) Need Help??


in reply to Re: Perlxs and C++ inheritance
in thread Perlxs and C++ inheritance

Yes it is always remain the same. The problem is: sometimes C++ need it to be different. For example, in multiple inheritance:
class Base1 {}; class Base2 {}; class Derived: public Base1, Base2 {}; ... Derived* obj = new Derived(); Base2* base_pointer = static_cast<Base2*> obj;

Replies are listed 'Best First'.
Re^3: Perlxs and C++ inheritance
by Anonymous Monk on Apr 24, 2014 at 09:51 UTC

    I don't understand :)(not that I did understand better before)

      I asked this question on StackOverflow from the aspect of C++. There are some guys provided useful hints:

      http://stackoverflow.com/questions/23451982/is-it-unsafe-to-store-derived-object-to-void-then-cast-base-object-out-of-it

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1083547]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2026-02-18 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.