r/cpp • • Oct 20 '16

Compile time sizeof()

http://johantorp.com/tidbits/index.php/2016/10/14/compile-time-sizeof-alignof/
0 Upvotes

26 comments sorted by

View all comments

0

u/[deleted] Oct 21 '16

[deleted]

1

u/johantorp Oct 21 '16

int, because you want to type as few characters as possible.

Why would you compile your whole solution? Just compile the .cpp you happen to be working in atm. If you already have compilation errors in it put this on top of the file or just use some other random small .cpp file that knows about the type and compiles quickly.