You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per the thread in Firebase for Games, I'm updating the sample to work verbatim. I've made the following changes:
I've replaced printf with std::cout (this is more C++, and should avoid code safety warnings on some compilers).
Rather than spinning on sign_in_future.status() and calling a non-existent function Wait, I register an OnCompletion listener as a lambda that captures no scope (for performance optimists out there, may avoid a heap allocation).
I made the type of the future explicit (the code as is wouldn't compile). It would read better as auto, but I think having a full type here is better for educational purposes.
All code after the spin lock-ish pattern is moved into the lambda.
I changed user->Anonymous() (doesn't exist) to user->is_anonymous().
I did my best to match the c++ style guide in the comment, but I expect that there'll be a critique or two.
I have verified the code working in a minimalist sample application.
I've just grabbed the suggested reviewers, sorry if this is out of nowhere!
PiperOrigin-RevId: 259400353
0 commit comments