We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我在项目中遇到的情况,在self_register_factory.hpp中,
template<typename... Args> register_t(const std::string& key, Args... args) { factory::get().map_.emplace(key, [&] { return new T(args...); }); }
这里的lambda表达式应该按值("=")来捕获,如果采用引用捕获的话,之后在调用 factory::get().produce生产产品的时候可能会出现空悬引用
The text was updated successfully, but these errors were encountered:
是参数失效了,要改一下。
Sorry, something went wrong.
No branches or pull requests
我在项目中遇到的情况,在self_register_factory.hpp中,
template<typename... Args>
register_t(const std::string& key, Args... args)
{
factory::get().map_.emplace(key, [&] { return new T(args...); });
}
这里的lambda表达式应该按值("=")来捕获,如果采用引用捕获的话,之后在调用
factory::get().produce生产产品的时候可能会出现空悬引用
The text was updated successfully, but these errors were encountered: