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

Impact of C++20 aggregate init with parentheses on our code

    XMLWordPrintable

Details

    • Epic
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Core: Other
    • None
    • C++20 aggregate-init @ Qt

    Description

      C++20 solved the problem that the likes of std::make_unique and std::make_shared cannot be used to create a non-default-constructed aggregate, because they use new T(~~~) when aggregates need new T{~~}. They solved it by allowing aggregate initialization to use parentheses instead of braces, such that new T(~~~) compiles even when T is an aggregate.

      Once we can depend on C++20, I expect more classes to become simple structs as a result of this change, CTAD for aggregates (QTBUG-104152) and designated initializers (QTBUG-104153).

      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