forked from BigfootDev/flatbuffers
fix ptr in flatbuffers cpp tutorial (#6787)
Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -2970,7 +2970,7 @@ We can access the type to dynamically cast the data as needed (since the
|
|||||||
|
|
||||||
<div class="language-cpp">
|
<div class="language-cpp">
|
||||||
~~~{.cpp}
|
~~~{.cpp}
|
||||||
auto union_type = monster.equipped_type();
|
auto union_type = monster->equipped_type();
|
||||||
|
|
||||||
if (union_type == Equipment_Weapon) {
|
if (union_type == Equipment_Weapon) {
|
||||||
auto weapon = static_cast<const Weapon*>(monster->equipped()); // Requires `static_cast`
|
auto weapon = static_cast<const Weapon*>(monster->equipped()); // Requires `static_cast`
|
||||||
|
|||||||
Reference in New Issue
Block a user