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

Unified Diff: mojo/public/cpp/bindings/type_converter.h

Issue 294833002: Mojo: more idiomatic C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 6 years, 7 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/type_converter.h
diff --git a/mojo/public/cpp/bindings/type_converter.h b/mojo/public/cpp/bindings/type_converter.h
index 147d83b495f2d39d918d732cd98be1616329ce05..e3e79c27f0412065d971ed3b0ca2bce7bffbc358 100644
--- a/mojo/public/cpp/bindings/type_converter.h
+++ b/mojo/public/cpp/bindings/type_converter.h
@@ -83,34 +83,11 @@ namespace mojo {
// output_2 = pt;
// }
//
-// There is another macro to inherit implicit conversion settings from another
-// TypeConverter:
-// MOJO_INHERIT_IMPLICIT_TYPE_CONVERSION(X, Y);
-//
-// It allows implicit conversions if and only if TypeConverter<X, Y> allows
-// implicit conversions. This is useful when defining TypeConverter for
-// container types.
-//
-// Although these macros are convenient, they make conversions less obvious.
-// Users may do conversions excessively without paying attention to the cost. So
-// please use them wisely.
template <typename T, typename U> class TypeConverter {
- // static T ConvertFrom(const U& input, Buffer* buf);
+ // static T ConvertFrom(const U& input);
// static U ConvertTo(const T& input);
-
- // Maybe (mutually exclusive):
- // MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION();
- // MOJO_INHERIT_IMPLICIT_TYPE_CONVERSION(X, Y);
};
} // namespace mojo
-#define MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION() \
- static void AssertAllowImplicitTypeConversion() {}
-
-#define MOJO_INHERIT_IMPLICIT_TYPE_CONVERSION(T, U) \
- static void AssertAllowImplicitTypeConversion() { \
- TypeConverter<T, U>::AssertAllowImplicitTypeConversion(); \
- }
-
#endif // MOJO_PUBLIC_CPP_BINDINGS_TYPE_CONVERTER_H_

Powered by Google App Engine
This is Rietveld 408576698