mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-01 17:57:25 +00:00
fix ptr in flatbuffers cpp tutorial (#6787)
Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
parent
067dce6e79
commit
d6f51ea16d
1 changed files with 1 additions and 1 deletions
|
|
@ -2970,7 +2970,7 @@ We can access the type to dynamically cast the data as needed (since the
|
|||
|
||||
<div class="language-cpp">
|
||||
~~~{.cpp}
|
||||
auto union_type = monster.equipped_type();
|
||||
auto union_type = monster->equipped_type();
|
||||
|
||||
if (union_type == Equipment_Weapon) {
|
||||
auto weapon = static_cast<const Weapon*>(monster->equipped()); // Requires `static_cast`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue