vendredi 9 octobre 2020

error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?

I'm compiling with Qt 5.11.3 on macOS 10.13.6. The clang version used by Qt is:

$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -v
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

But I'm receiving this error:

error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
using FloatingOnly = std::enable_if_t<std::is_floating_point<T>::value, O>;
                     ~~~~~^~~~~~~~~~~
                          enable_if
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:423:63: note: 'enable_if' declared here
template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if {};
                                                              ^

Tried

So far, I have done these, with no effect:

// On source *.cpp file

#include <type_traits>
# On project *.pro file

CONFIG += c++17
QMAKE_CXXFLAGS += -std=c++17 # for Clang
QMAKE_CXXFLAGS += -stdlib=libc++ # xcode_settings
QMAKE_CXXFLAGS += -std=c++11

Aucun commentaire:

Enregistrer un commentaire