diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-21 12:18:35 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-09-04 10:41:00 (GMT) |
commit | bd3c95917dfe2c2740403176935bf84ada9df403 (patch) | |
tree | 3537e3ded35d0ba6a919d5ee08c21c283eafcea8 | |
parent | b9fdc5636c166e26195d783378ff4da43b755bc5 (diff) | |
download | Qt-bd3c95917dfe2c2740403176935bf84ada9df403.zip Qt-bd3c95917dfe2c2740403176935bf84ada9df403.tar.gz Qt-bd3c95917dfe2c2740403176935bf84ada9df403.tar.bz2 |
Fix compilation with Sun CC 5.9: moving elements in a vector requires source not to be const
I don't know why the compiler couldn't call src->~T() on a const T *src,
but fact is it couldn't.
In any case, since move is copying the source and deleting it, formally
the argument shouldn't be const anyway.
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h index 11c20a9..7decc4a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h @@ -129,7 +129,7 @@ namespace WTF { template<typename T> struct VectorMover<false, T> { - static void move(const T* src, const T* srcEnd, T* dst) + static void move(T* src, const T* srcEnd, T* dst) { while (src != srcEnd) { new (dst) T(*src); @@ -138,7 +138,7 @@ namespace WTF { ++src; } } - static void moveOverlapping(const T* src, const T* srcEnd, T* dst) + static void moveOverlapping(T* src, const T* srcEnd, T* dst) { if (src > dst) move(src, srcEnd, dst); @@ -157,11 +157,11 @@ namespace WTF { template<typename T> struct VectorMover<true, T> { - static void move(const T* src, const T* srcEnd, T* dst) + static void move(T* src, const T* srcEnd, T* dst) { memcpy(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src)); } - static void moveOverlapping(const T* src, const T* srcEnd, T* dst) + static void moveOverlapping(T* src, const T* srcEnd, T* dst) { memmove(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src)); } @@ -254,12 +254,12 @@ namespace WTF { VectorInitializer<VectorTraits<T>::needsInitialization, VectorTraits<T>::canInitializeWithMemset, T>::initialize(begin, end); } - static void move(const T* src, const T* srcEnd, T* dst) + static void move(T* src, const T* srcEnd, T* dst) { VectorMover<VectorTraits<T>::canMoveWithMemcpy, T>::move(src, srcEnd, dst); } - static void moveOverlapping(const T* src, const T* srcEnd, T* dst) + static void moveOverlapping(T* src, const T* srcEnd, T* dst) { VectorMover<VectorTraits<T>::canMoveWithMemcpy, T>::moveOverlapping(src, srcEnd, dst); } |