C++ Utils  0.1
utils/arrayutils.h
Go to the documentation of this file.
00001 
00037 #ifndef UTILS_ARRAYUTILS_H
00038 #define UTILS_ARRAYUTILS_H
00039 
00040 namespace utils
00041 {
00042 
00046 class ArrayUtils
00047 {
00048 public:
00055         template<typename T, size_t N>
00056         static size_t size(const T (&a)[N])
00057         {
00058                 return N;
00059         }
00060 
00067         template<typename T>
00068         static size_t size(const T (&a)[0])
00069         {
00070                 return 0;
00071         }
00072 
00081         template<typename T>
00082         static size_t size(const T &a)
00083         {
00084                 return a.size();
00085         }
00086 };
00087 
00088 }
00089 
00090 #endif // UTILS_ARRAYUTILS_H
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines