How does this Array Size Template Work?

前端 未结 3 1754
臣服心动
臣服心动 2020-12-10 02:41

I came across this snippet

template   
char (&ArraySizeHelper(T (&array)[N]))[N];  
#define arraysize(array) (sizeof(Arra         


        
3条回答
  •  情歌与酒
    2020-12-10 03:04

    This blog on MSDN precisely describes how it works. Very interesting story. Take a look at it.

提交回复
热议问题