Index: Source/wtf/PassOwnPtr.h |
diff --git a/Source/wtf/PassOwnPtr.h b/Source/wtf/PassOwnPtr.h |
index 64dbc38dc06ba91410b5d54379c0282e39715dee..c35aefec67576049de781568f118d592caf6bf6e 100644 |
--- a/Source/wtf/PassOwnPtr.h |
+++ b/Source/wtf/PassOwnPtr.h |
@@ -73,14 +73,14 @@ namespace WTF { |
private: |
explicit PassOwnPtr(PtrType ptr) : m_ptr(ptr) { } |
- PassOwnPtr& operator=(const PassOwnPtr&) { COMPILE_ASSERT(!sizeof(T*), PassOwnPtr_should_never_be_assigned_to); return *this; } |
+ PassOwnPtr& operator=(const PassOwnPtr&) { static_assert(!sizeof(T*), "PassOwnPtr should never be assigned to"); return *this; } |
// We should never have two OwnPtrs for the same underlying object (otherwise we'll get |
// double-destruction), so these equality operators should never be needed. |
- template<typename U> bool operator==(const PassOwnPtr<U>&) const { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; } |
- template<typename U> bool operator!=(const PassOwnPtr<U>&) const { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; } |
- template<typename U> bool operator==(const OwnPtr<U>&) const { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; } |
- template<typename U> bool operator!=(const OwnPtr<U>&) const { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; } |
+ template<typename U> bool operator==(const PassOwnPtr<U>&) const { static_assert(!sizeof(U*), "OwnPtrs should never be equal"); return false; } |
+ template<typename U> bool operator!=(const PassOwnPtr<U>&) const { static_assert(!sizeof(U*), "OwnPtrs should never be equal"); return false; } |
+ template<typename U> bool operator==(const OwnPtr<U>&) const { static_assert(!sizeof(U*), "OwnPtrs should never be equal"); return false; } |
+ template<typename U> bool operator!=(const OwnPtr<U>&) const { static_assert(!sizeof(U*), "OwnPtrs should never be equal"); return false; } |
mutable PtrType m_ptr; |
}; |
@@ -88,7 +88,7 @@ namespace WTF { |
template<typename T> template<typename U> inline PassOwnPtr<T>::PassOwnPtr(const PassOwnPtr<U>& o, EnsurePtrConvertibleArgDefn(U, T)) |
: m_ptr(o.leakPtr()) |
{ |
- COMPILE_ASSERT(!IsArray<T>::value, Pointers_to_array_must_never_be_converted); |
+ static_assert(!IsArray<T>::value, "pointers to array must never be converted"); |
} |
template<typename T> inline typename PassOwnPtr<T>::PtrType PassOwnPtr<T>::leakPtr() const |
@@ -130,7 +130,7 @@ namespace WTF { |
template<typename T, typename U> inline PassOwnPtr<T> static_pointer_cast(const PassOwnPtr<U>& p) |
{ |
- COMPILE_ASSERT(!IsArray<T>::value, Pointers_to_array_must_never_be_converted); |
+ static_assert(!IsArray<T>::value, "pointers to array must never be converted"); |
return adoptPtr(static_cast<T*>(p.leakPtr())); |
} |