ARRAYSIZE:计算数组长度

ARRAYSIZE:计算数组长度

定义:

#define ARRAYSIZE(A)    RTL_NUMBER_OF_V2(A)

extern "C++" // templates cannot be declared to have 'C' linkage
template <typename T, size_t N>
char (*RtlpNumberOf( UNALIGNED T (&)[N] ))[N];	//详见"模板元编程"【http://saturnman.blog.163.com/blog/static/55761120107215259147/】


#define RTL_NUMBER_OF_V2(A) (sizeof(*RtlpNumberOf(A)))

待整理...

你可能感兴趣的:(ARRAYSIZE:计算数组长度)