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

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    2,274
    Timothy Bendfelt
    Jan 19, 2007
  2. Martin Vorbrodt

    order of bit fields

    Martin Vorbrodt, Nov 1, 2005, in forum: C++
    Replies:
    6
    Views:
    1,666
  3. Replies:
    9
    Views:
    1,390
    Juha Nieminen
    Aug 22, 2007
  4. call_me_anything
    Replies:
    4
    Views:
    713
    Pete Becker
    Sep 30, 2007
  5. Cyril.Liu
    Replies:
    0
    Views:
    629
    Cyril.Liu
    Dec 2, 2008
  6. middletree

    how to copy from fields to other fields

    middletree, Nov 5, 2003, in forum: ASP General
    Replies:
    1
    Views:
    323
    middletree
    Nov 5, 2003
  7. Replies:
    0
    Views:
    440
  8. Jeff.M
    Replies:
    6
    Views:
    408
    Lasse Reichstein Nielsen
    May 4, 2009
Loading...