Thread overview | |||||
---|---|---|---|---|---|
|
April 10, 2011 Specify bitwidth in D | ||||
---|---|---|---|---|
| ||||
in C++ we can specify the bitwidth in the declaration. So we can optimaze memory usage. unsigned int x : 30; unsigned int type : 2; How can we do that in D? °Matthias |
April 10, 2011 Re: Specify bitwidth in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Pleh | On 4/10/11 6:41 PM, Matthias Pleh wrote:
> in C++ we can specify the bitwidth in the declaration.
> So we can optimaze memory usage.
>
> unsigned int x : 30;
> unsigned int type : 2;
>
> How can we do that in D?
You can't – if you need packed bit fields, have a look at std.bitmanip.
David
|
April 10, 2011 Re: Specify bitwidth in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger | Am 10.04.2011 18:54, schrieb David Nadlinger:
> On 4/10/11 6:41 PM, Matthias Pleh wrote:
>> in C++ we can specify the bitwidth in the declaration.
>> So we can optimaze memory usage.
>>
>> unsigned int x : 30;
>> unsigned int type : 2;
>>
>> How can we do that in D?
>
> You can't – if you need packed bit fields, have a look at std.bitmanip.
>
> David
Ah, thanks. That fits!
°Matthias
|
Copyright © 1999-2021 by the D Language Foundation