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

QTypeTraits templates break existing code

XMLWordPrintable

    • ce83e56cfeb2806181ec1daade9690f4c90b901c (qt/qtbase/dev) 687685f64928ed69b2161f9f2ff4f303bec04967 (qt/qtbase/6.0) 0a9711d668f7ad7b156fa4e78afb54a97243b7ef (qt/qtbase/6.1)

      It seems that Qt6 doesn't allow the type 'S' to act as a container for items of the type 'S'.

      The following code fails to compile with Qt6 (but compiles with Qt5): 

      struct S {
        using value_type = S; // causes compile error with Qt6
        int begin();
        int end();
      };
      
      Q_DECLARE_METATYPE(S)
      

      Here are some compiler errors:

      'value': is not a member of 'QTypeTraits::detail::expand_operator_equal_container<T,true>'
      
      'value': is not a member of 'QTypeTraits::detail::expand_operator_equal_container<S::value_type,true>'

      Similar messages about 'expand_operator_less_than_container' template are printed.

      "Recursive" containers are sometimes useful. An example is nlohmann::json. However, changes introduced by Qt6 break applications that use such a types with the Qt property system (see also the issue description here)

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

            fabiankosmale Fabian Kosmale
            karzhenkov Alexander Karzhenkov
            Maurice Kalinowski Maurice Kalinowski
            Alex Blasche Alex Blasche
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes