quanzhou
unread,Apr 11, 2023, 1:03:21 PM4/11/23You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
#include <concepts>
struct Callback{};
template<typename... Args, std::invocable<Args..., Callback> Func> void reg(Func)
{
}
int main()
{
// good
reg<double, char>([](double, char, Callback) -> void
{
});
// bad
reg([](double, char, Callback)
{
});
return 0;
}
Tried g++-11, error as following:
/usr/include/c++/11/concepts: In substitution of ‘template<class ... Args, class Func> requires invocable<Func, Args ..., Callback> void reg(Func) [with Args = {}; Func = main()::<lambda(double, char, Callback)>]’
See Args get as {} while Func is correct.
What I would like is Args to be {double, char}, why I need to explicitly provide it?
Thanks all you experts.