… | |
… | |
55 | #endif |
55 | #endif |
56 | |
56 | |
57 | // use C0X decltype for auto declarations until ISO C++ sanctifies them (if ever) |
57 | // use C0X decltype for auto declarations until ISO C++ sanctifies them (if ever) |
58 | #define auto(var,expr) decltype(expr) var = (expr) |
58 | #define auto(var,expr) decltype(expr) var = (expr) |
59 | |
59 | |
60 | #if cplusplus_does_not_suck |
60 | #if cplusplus_does_not_suck /* still sucks in codesize with gcc 6, although local types work now */ |
61 | // does not work for local types (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) |
61 | // does not work for local types (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) |
62 | template<typename T, int N> |
62 | template<typename T, int N> |
63 | static inline int array_length (const T (&arr)[N]) |
63 | static inline int array_length (const T (&arr)[N]) |
64 | { |
64 | { |
65 | return N; |
65 | return N; |