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

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

Issue 923033003: Implement unions as members of structs. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_serialization.h ('k') | mojo/public/cpp/bindings/lib/template_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/bindings_internal.h
diff --git a/mojo/public/cpp/bindings/lib/bindings_internal.h b/mojo/public/cpp/bindings/lib/bindings_internal.h
index a8f95b2300bdb8143a8adecbb89afa9345f75830..4b5bb49d994183b6a303928354ef662571464afd 100644
--- a/mojo/public/cpp/bindings/lib/bindings_internal.h
+++ b/mojo/public/cpp/bindings/lib/bindings_internal.h
@@ -76,6 +76,18 @@ struct IsHandle {
enum { value = IsBaseOf<Handle, H>::value };
};
+template <typename T>
+struct IsUnionDataType {
+ template <typename U>
+ static YesType Test(const typename U::MojomUnionDataType*);
+
+ template <typename U>
+ static NoType Test(...);
+
+ static const bool value =
+ sizeof(Test<T>(0)) == sizeof(YesType) && !IsConst<T>::value;
+};
+
template <typename T, bool move_only = IsMoveOnlyType<T>::value>
struct WrapperTraits;
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_serialization.h ('k') | mojo/public/cpp/bindings/lib/template_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698