Title: [201260] trunk/Source/WTF
- Revision
- 201260
- Author
- [email protected]
- Date
- 2016-05-22 15:22:38 -0700 (Sun, 22 May 2016)
Log Message
Additional fixes for non-C++14 Apple projects that use WTF.
* wtf/StdLibExtras.h:
(std::exchange):
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (201259 => 201260)
--- trunk/Source/WTF/ChangeLog 2016-05-22 22:21:38 UTC (rev 201259)
+++ trunk/Source/WTF/ChangeLog 2016-05-22 22:22:38 UTC (rev 201260)
@@ -3,6 +3,13 @@
Additional fixes for non-C++14 Apple projects that use WTF.
* wtf/StdLibExtras.h:
+ (std::exchange):
+
+2016-05-22 Dan Bernstein <[email protected]>
+
+ Additional fixes for non-C++14 Apple projects that use WTF.
+
+ * wtf/StdLibExtras.h:
(std::make_unique):
(std::move):
Modified: trunk/Source/WTF/wtf/StdLibExtras.h (201259 => 201260)
--- trunk/Source/WTF/wtf/StdLibExtras.h 2016-05-22 22:21:38 UTC (rev 201259)
+++ trunk/Source/WTF/wtf/StdLibExtras.h 2016-05-22 22:22:38 UTC (rev 201260)
@@ -348,6 +348,16 @@
template<class T, class... Args> typename _Unique_if<T>::_Known_bound
make_unique(Args&&...) = delete;
+
+// std::exchange
+template<class T, class U = T>
+T exchange(T& t, U&& newValue)
+{
+ T oldValue = std::move(t);
+ t = std::forward<U>(newValue);
+
+ return oldValue;
+}
#endif
template<WTF::CheckMoveParameterTag, typename T>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes