I know in the C++ spec it states that pointers to bitfields are disallowed. There must be some sort of a workaround to this, however, as std::bitset seems to allow direct access (via pointer) to its bit fields (specifically with operator[]). How is this accomplished?
Is there any way to make something like the following work, such that you could manipulate the value of a bitfield with an external pointer (just like operator[] seems to do in std::bitset)?
Perhaps I could use std::bitset::reference in a similar way (or create my own). Nothing is wrong with using the bitset method set(), except I'm not trying to use bitset myself just mimic it's ability to have operator[] overloaded for what appear to be bitfields.
Is there any method you guys can think of to make the first example work, where *char1ptr can be used to reference a bitfield (ie. mybitfield.var4) of the same size?