Skip to content
New issue

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

Lazy测试代码无法通过编译 #36

Open
bobhan1 opened this issue Dec 27, 2020 · 1 comment
Open

Lazy测试代码无法通过编译 #36

bobhan1 opened this issue Dec 27, 2020 · 1 comment

Comments

@bobhan1
Copy link

bobhan1 commented Dec 27, 2020

Mystruct中m_obj = lazy([]{return std::make_shared<Big>(); });在gcc与msvc下均无法通过编译
gcc报错信息
cannot bind non-const lvalue reference of type 'Mystruct::Mystruct()::<lambda()>&' to an rvalue of type 'Mystruct::Mystruct()::<lambda()>'

将其改为
auto temp=[]{return std::make_shared<Big>(); };
m_obj = lazy(temp);
后可以通过编译

@qicosmos
Copy link
Owner

qicosmos commented Jan 7, 2021

谢谢报告这个错误。
你可以提一个pr过来修复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants