Bitfield structs and suggestion

Leandro Lucarella llucax at gmail.com
Thu Nov 29 06:44:00 PST 2007


Janice Caron, el 29 de noviembre a las 08:45 me escribiste:
> On Nov 23, 2007 5:50 PM, Janice Caron <caron800 at googlemail.com> wrote:
> > I think the way to do it to have the compiler automagically write
> > getter and setter functions for you. That way, the following would be
> > allowed:
> >
> >     n = s.a; // read a bitfield
> >     s.a = n; // write a bitfield
> >
> > but things like s.a+=, &s.a, passing bitfields by reference, and so
> > on, would still be disallowed. That would force the programmer to do
> > all the calculations in "real" ints, using the bitfields only for
> > storage.
> 
> Hey, someone's been listening to me! :-)
> 
> Check out std.bitmanip in D2.008.
> 
> We have bitfields.

*Ugly* bitfields, but bitfield at last (language support would be much
nicer... :S)

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Charles Chaplin once won 3rd price in a Charles Chaplin look-a-like contest



More information about the Digitalmars-d mailing list