Overlapping class members

Here's the deal - I have two one 16bit member variable, and two 8bit member variables within a C++ class.
Rather than each one occupy it's own position in memory, I'd like all three to share the same 16bit space as follows:
- The 16bit variable should reside at memory location X.
- The first 8bit variable should reside at memory location X.
- The second 8bit variable should reside at memory location X+1.
Therefore:
- Changing the value of the 16bit variable will change the value of both 8bit variables
- Changing the value of the first 8bit variable will change the value of the low byte of the 16bit variable
- Changing the value of the second 8bit variable will change the value of the high byte of the 16bit variable
I know this is possible in some way or another using unions, but I'm after a way of doing things where I don't have to place the variables within a structure.
Any ideas appreciated, however wacky!
Cheers
Jon
Rather than each one occupy it's own position in memory, I'd like all three to share the same 16bit space as follows:
- The 16bit variable should reside at memory location X.
- The first 8bit variable should reside at memory location X.
- The second 8bit variable should reside at memory location X+1.
Therefore:
- Changing the value of the 16bit variable will change the value of both 8bit variables
- Changing the value of the first 8bit variable will change the value of the low byte of the 16bit variable
- Changing the value of the second 8bit variable will change the value of the high byte of the 16bit variable
I know this is possible in some way or another using unions, but I'm after a way of doing things where I don't have to place the variables within a structure.
Any ideas appreciated, however wacky!
Cheers
Jon