Is sizeof(void()) a legal expression?

前端 未结 6 1655
暖寄归人
暖寄归人 2020-12-09 07:03

From [5.3.3/1], I found that:

The sizeof operator shall not be applied to an expression that has function or incomplete type

Fro

6条回答
  •  心在旅途
    2020-12-09 08:05

    void() is a function type (it's a function which takes no arguments and returns nothing), so it's not a valid type in sizeof().

提交回复
热议问题