Title: [149112] trunk/Source/WTF
- Revision
- 149112
- Author
- [email protected]
- Date
- 2013-04-25 08:17:57 -0700 (Thu, 25 Apr 2013)
Log Message
Use std::move in AtomicString
https://bugs.webkit.org/show_bug.cgi?id=115102
Reviewed by Anders Carlsson.
Use std::move in AtomicString instead of direct casting to rvalue references.
* wtf/text/AtomicString.h:
(AtomicString):
(WTF::AtomicString::AtomicString):
(WTF::AtomicString::operator=):
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (149111 => 149112)
--- trunk/Source/WTF/ChangeLog 2013-04-25 14:52:27 UTC (rev 149111)
+++ trunk/Source/WTF/ChangeLog 2013-04-25 15:17:57 UTC (rev 149112)
@@ -1,3 +1,17 @@
+2013-04-25 Mikhail Pozdnyakov <[email protected]>
+
+ Use std::move in AtomicString
+ https://bugs.webkit.org/show_bug.cgi?id=115102
+
+ Reviewed by Anders Carlsson.
+
+ Use std::move in AtomicString instead of direct casting to rvalue references.
+
+ * wtf/text/AtomicString.h:
+ (AtomicString):
+ (WTF::AtomicString::AtomicString):
+ (WTF::AtomicString::operator=):
+
2013-04-25 Patrick Gansterer <[email protected]>
Unreviewed WinCE build fix after r148888.
Modified: trunk/Source/WTF/wtf/text/AtomicString.h (149111 => 149112)
--- trunk/Source/WTF/wtf/text/AtomicString.h 2013-04-25 14:52:27 UTC (rev 149111)
+++ trunk/Source/WTF/wtf/text/AtomicString.h 2013-04-25 15:17:57 UTC (rev 149112)
@@ -21,6 +21,7 @@
#ifndef AtomicString_h
#define AtomicString_h
+#include <utility>
#include <wtf/text/AtomicStringImpl.h>
#include <wtf/text/WTFString.h>
@@ -76,12 +77,10 @@
#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
// We have to declare the copy constructor and copy assignment operator as well, otherwise
// they'll be implicitly deleted by adding the move constructor and move assignment operator.
- // FIXME: Instead of explicitly casting to String&& here, we should use std::move, but that requires us to
- // have a standard library that supports move semantics.
AtomicString(const AtomicString& other) : m_string(other.m_string) { }
- AtomicString(AtomicString&& other) : m_string(static_cast<String&&>(other.m_string)) { }
+ AtomicString(AtomicString&& other) : m_string(std::move(other.m_string)) { }
AtomicString& operator=(const AtomicString& other) { m_string = other.m_string; return *this; }
- AtomicString& operator=(AtomicString&& other) { m_string = static_cast<String&&>(other.m_string); return *this; }
+ AtomicString& operator=(AtomicString&& other) { m_string = std::move(other.m_string); return *this; }
#endif
// Hash table deleted values, which are only constructed and never copied or destroyed.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes