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

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

XMLWordPrintable

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

      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).

        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:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes