From bd3c95917dfe2c2740403176935bf84ada9df403 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 21 Jul 2009 14:18:35 +0200 Subject: 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. --- src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h | 12 ++++++------ 1 file 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 struct VectorMover { - 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 struct VectorMover { - 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(srcEnd) - reinterpret_cast(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(srcEnd) - reinterpret_cast(src)); } @@ -254,12 +254,12 @@ namespace WTF { VectorInitializer::needsInitialization, VectorTraits::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::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::canMoveWithMemcpy, T>::moveOverlapping(src, srcEnd, dst); } -- cgit v0.12