Bit Order in Bit Fields

  • Thread starter Mike -- Email Ignored
  • Start date
M

Mike -- Email Ignored

In bit fields, am I guaranteed that the order
of the bits used is from low to high?

For example, in the fragment below, am I
guaranteed that the symbol "hi" refers to
the high order bit in an element of
type TYP (as it does on my box)?

template <class TYP>
struct Sfield
{
TYP lo : sizeof(TYP) * 8 - 1;
TYP hi : 1;
};

Thanks,
Mike.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top