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

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

    XMLWordPrintable

Details

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

    Description

      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.

      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