_countof

template <typename _CountofType, size_t _SizeOfArray>
char (*__countof_helper(UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
#define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0)

 

posted @ 2013-11-19 19:57  avexer  阅读(163)  评论(0编辑  收藏  举报