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

Impact of C++20 class-type NTTPs on our code

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • None
    • Core: Other
    • None
    • C++20 class-type NTTPs @ Qt

      C++20 added support for NNTPs (Non-Type Template Parameters) of class type, provided the type is

      1. literal
      2. only public members (incl. bases)
      3. has strong structural equality
        • public op==() = default, and within the class body, and all non-static data members have strong structural equality, too, recursively
      4. no mutable or volatile members

      It would be nice if e.g. QFlags was such a type (it currently isn't).

      The C++20 semantics require such types to have public members. https://wg21.link/P2484 aims to remove this restriction, but it's not seen a revision since last year and won't be in C++23. We might need to wait until a version of that paper is accepted.

        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