UmbralRaptor changed the topic of #kspacademia to: https://gist.github.com/pdn4kd/164b9b85435d87afbec0c3a7e69d3e6d | Dogs are cats. Spiders are cat interferometers. | Космизм сегодня! | Document well, for tomorrow you may get mauled by a ネコバス. | <UmbralRaptor> egg|nomz|egg: generally if your eyes are dewing over, that's not the weather. | <ferram4> I shall beat my problems to death with an engineer. | We can haz pdf
egg|cell|egg has quit [Ping timeout: 204 seconds]
egg|cell|egg has joined #kspacademia
e_14159 has joined #kspacademia
e_14159_ has quit [Ping timeout: 378 seconds]
raptop has quit [Ping timeout: 378 seconds]
raptop has joined #kspacademia
egg|laptop|egg has quit [Remote host closed the connection]
<whitequark>
egg|cell|egg: can i cast Derived to Base if Derived : Base and it introduces no new fields?
<whitequark>
i.e. the cast is no-op from the layout point of view, but the object was originally allocated as Derived
<whitequark>
err
<whitequark>
cast Base to Derived
<whitequark>
(since in the other direction the answer is "yes obviously")
<egg|cell|egg>
Hmmm
<egg|cell|egg>
I think it might ub to cast like that at 4:30 in the morning but maybe it is defined if the sun is up
<whitequark>
:/
<whitequark>
bonus points: the pointer to Base comes from C so the C++ compiler doesn't ever observe it being allocated
<egg|cell|egg>
Even if ub it might not be exploited ub
<egg|cell|egg>
Hmmmm
<SnoopJeDi>
UBTC
<whitequark>
and Base is defined in a C header
<whitequark>
well, a header shared between C++ and C code
<egg|cell|egg>
How do vtables work
<whitequark>
no vtables
<whitequark>
it's a POD
<whitequark>
well
<whitequark>
it's a standard layout class
<egg|cell|egg>
Probably ubbutfine?
<egg|cell|egg>
Cat is meowing
<whitequark>
ugh fine i'll just copy it
<whitequark>
this time i don't capture the pointer
<egg|cell|egg>
So I assume the cat disagrees with my analysis
<whitequark>
actually i should definitely copy because i might want to add stuff to Derived later
<whitequark>
thanks cat
<egg|cell|egg>
You were asking about C++ experts earlier, clearly my cat is the only C++ expert
<egg|cell|egg>
Note, my answers are from memory because trying to zzz, I am likely wrong in some way
<egg|cell|egg>
Will check later
<whitequark>
feel free to skip, I already figured that I need to copy anyways
Wetmelon has joined #kspacademia
egg|cell|egg has quit [Ping timeout: 190 seconds]
egg|laptop|egg has joined #kspacademia
Wetmelon has quit [Ping timeout: 378 seconds]
egg|laptop|egg has quit [Ping timeout: 378 seconds]