Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. "enable_if_t" has no member "type"

"enable_if_t" has no member "type"

Scheduled Pinned Locked Moved Solved Qt 6
4 Posts 3 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Timothy_Xin
    wrote on last edited by
    #1

    Hello there,

    I'm completely new to Qt. Just downloaded the Qt6 and try to play with the examples.
    The OS is Ubuntu 20.04 LTS and the Qt version is 6.1.0.
    Every time I tried to compile the project I got the following error message:
    /usr/include/c++/9/type_traits:2385: error: class "std::enable_if<false, void>" has no member "type"
    using enable_if_t = typename enable_if<_Cond, _Tp>::type;
    detected during:
    instantiation of type "std::enable_if_t<false, void>" at line 271 of "~/Qt/6.1.0/gcc_64/include/QtCore/qlist.h"
    instantiation of class "QList<T> [with T=uint={unsigned int}]" at line 939 of "~/Qt/6.1.0/gcc_64/include/QtCore/qlist.h"

    Can anyone please help me out here?

    Many thx.

    Chris KawaC 1 Reply Last reply
    0
    • T Timothy_Xin

      Hello there,

      I'm completely new to Qt. Just downloaded the Qt6 and try to play with the examples.
      The OS is Ubuntu 20.04 LTS and the Qt version is 6.1.0.
      Every time I tried to compile the project I got the following error message:
      /usr/include/c++/9/type_traits:2385: error: class "std::enable_if<false, void>" has no member "type"
      using enable_if_t = typename enable_if<_Cond, _Tp>::type;
      detected during:
      instantiation of type "std::enable_if_t<false, void>" at line 271 of "~/Qt/6.1.0/gcc_64/include/QtCore/qlist.h"
      instantiation of class "QList<T> [with T=uint={unsigned int}]" at line 939 of "~/Qt/6.1.0/gcc_64/include/QtCore/qlist.h"

      Can anyone please help me out here?

      Many thx.

      Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      Hi, welcome to the forum.

      The ::type helper was added in C++14 so it seems you're running your compiler in C++11 mode.
      Qt 6 requires C++17, so you need to make sure you're using that version of the standard: CONFIG += c++17 in the .pro file if you're using qmake.

      VRoninV 1 Reply Last reply
      5
      • Chris KawaC Chris Kawa

        Hi, welcome to the forum.

        The ::type helper was added in C++14 so it seems you're running your compiler in C++11 mode.
        Qt 6 requires C++17, so you need to make sure you're using that version of the standard: CONFIG += c++17 in the .pro file if you're using qmake.

        VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by
        #3

        @Chris-Kawa said in "enable_if_t" has no member "type":

        CONFIG += c++17 in the .pro file if you're using qmake.

        And if you are using CMake

        set_target_properties(MyApplication PROPERTIES
            CXX_STANDARD 17
            CXX_STANDARD_REQUIRED ON
        )
        

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        4
        • T Offline
          T Offline
          Timothy_Xin
          wrote on last edited by
          #4

          Thank you guys. Problem solved. Added the flag as Chris suggested. It turns out I was also using icpc as my default compiler and that was also giving my trouble.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved