Bit Order in Bit Fields

Discussion in 'C++' started by Mike -- Email Ignored, May 2, 2009.

  1. 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.
     
    Mike -- Email Ignored, May 2, 2009
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.