Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: compat/non_cxx11_lib/type_traits

Issue 1513573005: Provide std::move() in compat instead of using crashpad::move() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compat/compat.gyp ('k') | compat/non_cxx11_lib/utility » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compat/non_cxx11_lib/type_traits
diff --git a/util/misc/random_string.h b/compat/non_cxx11_lib/type_traits
similarity index 57%
copy from util/misc/random_string.h
copy to compat/non_cxx11_lib/type_traits
index 93b3a7fa4620f149529c8af1e9b067b9a81ca4a4..9f11fd4a8a234d2649494f74cd8c15060e1d6c5c 100644
--- a/util/misc/random_string.h
+++ b/compat/non_cxx11_lib/type_traits
@@ -12,20 +12,26 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef CRASHPAD_UTIL_MISC_RANDOM_STRING_H_
-#define CRASHPAD_UTIL_MISC_RANDOM_STRING_H_
+#ifndef CRASHPAD_COMPAT_NON_CXX11_LIB_TYPE_TRAITS_
+#define CRASHPAD_COMPAT_NON_CXX11_LIB_TYPE_TRAITS_
-#include <string>
+#include "util/stdlib/cxx.h"
-namespace crashpad {
+#if CXX_LIBRARY_VERSION >= 2011
-//! \brief Returns a random string.
-//!
-//! The string consists of 16 uppercase characters chosen at random. The
-//! returned string has over 75 bits of randomness (26<sup>16</sup> &gt;
-//! 2<sup>75</sup>).
-std::string RandomString();
+#include_next <type_traits>
-} // namespace crashpad
+#else
-#endif // CRASHPAD_UTIL_MISC_RANDOM_STRING_H_
+namespace std {
+
+template <class T>
+struct remove_reference { using type = T; };
+template <class T>
+struct remove_reference<T&> { using type = T; };
+
+} // namespace std
+
+#endif // CXX_LIBRARY_VERSION
+
+#endif // CRASHPAD_COMPAT_NON_CXX11_LIB_TYPE_TRAITS_
« no previous file with comments | « compat/compat.gyp ('k') | compat/non_cxx11_lib/utility » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698