Open
Description
gcc13.1 -std=c++20
部分报错信息如下: https://godbolt.org/z/KzGoGbdvK
error: no matching function for call to 'forward(main()::<lambda(int)>&)'
29 | explicit _FuncImpl(std::in_place_t, _CArgs &&...__args) : _M_f(std::forward(__args)...) {}
GPT:std::make_unique 尝试调用 _FuncImpl 的构造函数时,传递的参数类型不匹配导致的。
确保 _FuncImpl 的构造函数能够正确处理函数指针的引用。通过添加一个额外的构造函数来处理。
能编译通过的代码:https://godbolt.org/z/h4KMKoMYc
Metadata
Metadata
Assignees
Labels
No labels