Recently, by looking at the source code of std::move
, I discovered that Qt links my programs with a version of the Standard Library which does not support C++11/14 features:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename remove_reference<_Tp>::type&&
move(_Tp&& __t) _NOEXCEPT
{
typedef typename remove_reference<_Tp>::type _Up;
return static_cast<_Up&&>(__t);
}
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp&
move(_Tp& __t)
{
return __t;
}
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
const _Tp&
move(const _Tp& __t)
{
return __t;
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Actually, the macro _LIBCPP_HAS_NO_RVALUE_REFERENCES
is defined (I use CONFIG += C++14
in my .pro
file, but this is a problem of the library).
Do I have to rebuild libc++ in order to use C++ features (like proper std::move
) with Qt? Or maybe I have to change some settings?
I use Qt 5.7 with LLVM 7.3.0.