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

Unified Diff: ppapi/cpp/output_traits.h

Issue 10068004: Fix IsBaseOf in output_traits.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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 | « ppapi/cpp/dev/audio_input_dev.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/output_traits.h
diff --git a/ppapi/cpp/output_traits.h b/ppapi/cpp/output_traits.h
index 963f296cc2ad63758be8866543dd5276a67f3c0e..186f0da52fd45ac73a68a1379610932a52e49db9 100644
--- a/ppapi/cpp/output_traits.h
+++ b/ppapi/cpp/output_traits.h
@@ -35,6 +35,11 @@ template<typename A> struct IsSame<A, A> {
static bool const value = true;
};
template<typename Base, typename Derived> struct IsBaseOf {
+ // This class doesn't work correctly with forward declarations.
+ // Because sizeof cannot be applied to incomplete types, this line prevents us
+ // from passing in forward declarations.
+ typedef char (*EnsureTypesAreComplete)[sizeof(Base) + sizeof(Derived)];
dmichael (off chromium) 2012/04/12 16:09:35 might as well put this in a private section. (actu
yzshen1 2012/04/12 16:30:46 Done. Thanks! The public section doesn't come fir
+
static Derived* CreateDerived();
static char (&Check(Base*))[1];
static char (&Check(...))[2];
« no previous file with comments | « ppapi/cpp/dev/audio_input_dev.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698