fix ptr in flatbuffers cpp tutorial (#6787)

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper 2021-08-16 14:43:26 -04:00 committed by GitHub
parent 067dce6e79
commit d6f51ea16d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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`