【发布时间】:2019-01-28 12:50:34
【问题描述】:
我在这里关注官方网站上的 c++ 教程 https://firebase.google.com/docs/auth/cpp/password-auth#register_callback_on_future
在那里,提到不支持 lambda 捕获,因为那里的编译器不支持 std::function。 但是,在这里https://firebase.google.com/support/release-notes/cpp-relnotes 在 2017 年 8 月 23 日发布的 4.1.0 版本中,提到他们增加了对 lambda 捕获的支持。
当我写这样的函数时
void CreateUserInFirebase(const std::string& Email, const std::string& Password)
{
auth->CreateUserWithEmailAndPassword(Email.c_str(), Password.c_str());
firebase::Future<firebase::auth::User*> Result = auth->CreateUserWithEmailAndPasswordLastResult();
Result.OnCompletion([&SomeVariable](const firebase::Future<firebase::auth::User*>& result, void* user_data)
{}, nullptr);
}
出现这个错误
错误:没有匹配的成员函数调用“OnCompletion”
注意:候选函数不可行:第一个参数没有从 lambda 到 'firebase::Future::TypedCompletionCallback'(又名 'void (*)(const Future &, void *)')的已知转换
是否在最新版本中删除了支持?
谢谢。
【问题讨论】:
标签: c++ firebase firebase-authentication