Index: include/core/SkTemplates.h |
=================================================================== |
--- include/core/SkTemplates.h (revision 9384) |
+++ include/core/SkTemplates.h (working copy) |
@@ -64,6 +64,11 @@ |
); |
} |
+/** Returns true if the source value 's' will fit in the destination type 'D'. */ |
+template <typename D, typename S> inline bool SkTFitsIn(S s) { |
+ return static_cast<D>(s) == s; |
+} |
+ |
/** \class SkAutoTCallVProc |
Call a function when this goes out of scope. The template uses two |