Practical Use of Zero-Length Bitfields
问题 I am not totally sure about C, but C++ allows unnamed bit-fields of 0 length. For example: struct X { int : 0; }; Question one: What practical uses of this can you think of? Question two: What real-world practical uses (if any) are you aware of? Edited the example after ice-crime\'s answer Edit: OK, thanks to the current answers I now know the theoretical purpose. But the questions are about practical uses so they still hold :) 回答1: You use a zero-length bitfield as a hacky way to get your