Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Good news, in C++20 you can add <> there somewhere, although probably it can't be empty.

Anyway, probably obscure enough:

  int main() {
      []<class=void>(){}();
  }


And in C++23 drop the arguments parenthesis, so this is also valid lambda call, :)

  int main() {
      []{}();
  }


[]{}() was always valid, but you can drop the arguments in more cases in C++23.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: