hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
array_size.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_COMMON_ARRAY_SIZE_HPP
7 #define IROHA_COMMON_ARRAY_SIZE_HPP
8 
9 #ifdef IROHA_ARRAY_SIZE
10 #error IROHA_ARRAY_SIZE already defined.
11 #endif // IROHA_ARRAY_SIZE
12 
13 #ifndef IROHA_ARRAY_SIZE
14 template <typename T, size_t N>
15 char (&IrohaArraySizeHelper(T (&array)[N]))[N];
16 #define IROHA_ARRAY_SIZE(array) (sizeof(IrohaArraySizeHelper(array)))
17 #endif // IROHA_ARRAY_SIZE
18 
19 #endif // IROHA_COMMON_ARRAY_SIZE_HPP
char(& IrohaArraySizeHelper(T(&array)[N]))[N]