From 83a3292342f70ba3bdc636c38031c6a1a74646c3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 4 Feb 2015 01:16:35 +0100 Subject: QPair: work around std::move not being constexpr in C++11 Use a static_cast instead. This is not 100% equivalent, since it's missing remove_reference<>, which we don't want to depend on and whose emulation in qtypetraits.h is missing rvalue support. That will be fixed in dev. Change-Id: Ib03754c81c904932943d3a5415b54ff107f4719d Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qpair.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/corelib/tools/qpair.h') diff --git a/src/corelib/tools/qpair.h b/src/corelib/tools/qpair.h index b2217e4dd0..76b7abd263 100644 --- a/src/corelib/tools/qpair.h +++ b/src/corelib/tools/qpair.h @@ -56,7 +56,9 @@ struct QPair { first = p.first; second = p.second; return *this; } #ifdef Q_COMPILER_RVALUE_REFS template - Q_DECL_CONSTEXPR QPair(QPair &&p) : first(std::move(p.first)), second(std::move(p.second)) {} + Q_DECL_CONSTEXPR QPair(QPair &&p) + // can't use std::move here as it's not constexpr in C++11: + : first(static_cast(p.first)), second(static_cast(p.second)) {} template QPair &operator=(QPair &&p) { first = std::move(p.first); second = std::move(p.second); return *this; } -- cgit v1.2.3