A workaround for C++23:
#include <concepts> #include <iostream> template <std::regular_invocable<> auto cstr> void f() { std::cout << cstr() << '\n'; } int main() { f<[]{return "template arg";}>(); }