sources/basics.h

changeset 113
b3a33bc2e482
parent 109
e4966d7e615d
child 114
0e7f3ecdf65a
--- a/sources/basics.h	Sun Jan 10 20:05:27 2016 +0200
+++ b/sources/basics.h	Sun Jan 10 20:53:44 2016 +0200
@@ -88,6 +88,10 @@
 	return (a < b) ? b : (a > c) ? c : a;
 }
 
+template <typename T, size_t N>
+char (&_ArraySizeHelper(T (&array)[N]))[N];
+#define countof(array) (sizeof(_ArraySizeHelper( array )))
+
 struct Exitception {};
 
 END_ZFC_NAMESPACE

mercurial