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

Impact of C++20 CTAD on our code

    XMLWordPrintable

Details

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

    Description

      C++20 added support for CTAD (https://en.cppreference.com/w/cpp/language/class_template_argument_deduction) for

      1. aggregates (__cpp_deduction_guides >= 201907L)
      2. aliases (__cpp_deduction_guides >= 201907L)

      The first is not really interesting, because we can emulate it using user-defined deduction guides, and we'd get the same result in C++17 and C++20. Once we can depend on C++20, I expect more classes to become simple structs as a result of this change, designated initializers (QTBUG-104153) and __cpp_aggregate_paren_init (QTBUG-104154).

      The second is interesting for our users, but doesn't affect our APIs.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes