Difference between revisions of "Intermediate C++ Game Programming Tutorial 19"
From Chilipedia
(→Video Timestamp Index) |
|||
Line 10: | Line 10: | ||
== Video Timestamp Index == | == Video Timestamp Index == | ||
[https://youtu.be/g-NGBFCn3co Tutorial 19] | [https://youtu.be/g-NGBFCn3co Tutorial 19] | ||
− | * | + | * If you have a pointer to a base type, how do you find out what derived types that base pointers is actually pointing to? [https://youtu.be/g-NGBFCn3co?t=54s 0:54] |
* WORK-IN-PROGRESS | * WORK-IN-PROGRESS | ||
Revision as of 04:12, 15 October 2019
In this video Chili teaches us how to figure out what our polymorphic pointers are actually pointing to (aka "type discovery"). Just note that although we can do this, it is generally a weaksauce way to go about things. Virtual functions are 1000% more hype than type discovery bullshit. Oh yeah, we also finally see all the C++ style casts united.
Topics Covered
-
dynamic_cast<T*>
anddynamic_cast<T&>
-
const_cast
- Overview of all C++ style casts
- RTTI with
typeid()
- The
type_info
class
Video Timestamp Index
- If you have a pointer to a base type, how do you find out what derived types that base pointers is actually pointing to? 0:54
- WORK-IN-PROGRESS
Source Code
Note that the code for this video is in a different branch called "casting". You will not find it in the master branch.