Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-104151

Impact of C++20 lambdas on our code

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Unresolved
    • Icon: P4: Low P4: Low
    • None
    • None
    • Core: Other
    • None
    • C++20 lambdas @ Qt

      TL;DR: uninteresting until we depend on C++20

      C++20 added more feature to lambda functions:

      1. optional template-initializer (__cpp_generic_lambdas >= 201707L)
      2. pack-expansion in init captures (__cpp_init_captures >= 201803L)
      3. lambdas can appear in unevaluated contexts:
        std::unique_ptr<FILE, decltype([](FILE *f) { fclose(f); })> file(fopen(~~~));
        
      4. stateless ones are default-constructible and assignable

      There's nothing we can do with these until we depend on C++20. When we do, these features will be useful in the implementation of Qt; I don't see an impact on our APIs atm.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            cnn Qt Core & Network
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes