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

Unified Diff: mojo/public/cpp/bindings/lib/template_util.h

Issue 2136733002: Mojo C++ bindings: add a new mode to generator to use native STL/WTF types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@67_new
Patch Set: . Created 4 years, 5 months 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
Index: mojo/public/cpp/bindings/lib/template_util.h
diff --git a/mojo/public/cpp/bindings/lib/template_util.h b/mojo/public/cpp/bindings/lib/template_util.h
index 4e4ce66b6f4b2b2d34448781bc3bdc0eb6e84736..5151123ac0b149d90f8bc87e14abe653dab70d89 100644
--- a/mojo/public/cpp/bindings/lib/template_util.h
+++ b/mojo/public/cpp/bindings/lib/template_util.h
@@ -114,54 +114,6 @@ struct Conditional<false, T, F> {
typedef F type;
};
-template <typename T>
-struct HasCloneMethod {
- template <typename U>
- static char Test(decltype(&U::Clone));
- template <typename U>
- static int Test(...);
- static const bool value = sizeof(Test<T>(0)) == sizeof(char);
-
- private:
- EnsureTypeIsComplete<T> check_t_;
-};
-
-template <typename T,
- typename std::enable_if<HasCloneMethod<T>::value>::type* = nullptr>
-T Clone(const T& input) {
- return input.Clone();
-};
-
-template <typename T,
- typename std::enable_if<!HasCloneMethod<T>::value>::type* = nullptr>
-T Clone(const T& input) {
- return input;
-}
-
-template <typename T>
-struct HasEqualsMethod {
- template <typename U>
- static char Test(decltype(&U::Equals));
- template <typename U>
- static int Test(...);
- static const bool value = sizeof(Test<T>(0)) == sizeof(char);
-
- private:
- EnsureTypeIsComplete<T> check_t_;
-};
-
-template <typename T,
- typename std::enable_if<HasEqualsMethod<T>::value>::type* = nullptr>
-bool Equals(const T& a, const T& b) {
- return a.Equals(b);
-};
-
-template <typename T,
- typename std::enable_if<!HasEqualsMethod<T>::value>::type* = nullptr>
-bool Equals(const T& a, const T& b) {
- return a == b;
-}
-
} // namespace internal
} // namespace mojo
« no previous file with comments | « mojo/public/cpp/bindings/lib/serialization_forward.h ('k') | mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698