What is the return type of sizeof operator?
C++11, §5.3.3 ¶6 The result of sizeof and sizeof… is a constant of type std::size_t. [ Note: std::size_t is defined in the standard header (18.2). — end note ] You can also do a quick check: which correctly outputs 1 on my machine. As @Adam D. Ruppe said in the comment, probably the compiler does not complain because, since it already knows the result, … Read more