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

That requires you to guess the size

0

u/[deleted] Oct 21 '16

[deleted]

2

u/johantorp Oct 21 '16

The whole point is to not do it manually - not having to go to the header file and find all members or worse have to follow a deep inheritance chain across lots of headers.

Should've been more clear about that, I'm a complete blogging n00b. At least I learned one important thing from this post - be extremely specific about what problem is being solved :)