Effective implementation of algorithms (Master Thesis)
Effective and error-free implementation of algorithms
src/utils/macros/array_size.h
Go to the documentation of this file.
00001 #ifndef H_UTILS_MACROS_ARRAY_SIZE
00002 #define H_UTILS_MACROS_ARRAY_SIZE
00003 
00010 template <typename T, unsigned int N>
00011 char (&ArraySizeHelper(T (&array)[N]))[N];
00012 
00013 template <typename T, unsigned int N>
00014 char (&ArraySizeHelper(const T (&array)[N]))[N];
00015 
00026 #define ARRAY_SIZE(array) (sizeof(ArraySizeHelper(array)))
00027 
00028 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines