| Thread overview | ||||||
|---|---|---|---|---|---|---|
|
February 09, 2014 wanna bitflags support | ||||
|---|---|---|---|---|
| ||||
bitflags WINSTYLEBITFLAGS : uint
{
WS_VISIBLE = 1,
WS_CHILD = 2,
...
}
bool CreateWindow(WINSTYLEBITFLAGS styles);
static assert(typeid(WS_VISIBLE) == typeid(WINSTYLEBITFLAGS));
static assert(typeid(WS_CHILD) == typeid(WINSTYLEBITFLAGS));
static assert(typeid(WS_VISIBLE | WS_CHILD) == typeid(WINSTYLEBITFLAGS));
How do you consider about this?
| ||||
February 09, 2014 Re: wanna bitflags support | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Katayama Hirofumi MZ | Katayama Hirofumi MZ:
> How do you consider about this?
I think the D language is probably able to implement something like that in Phobos code, like the bitfields.
Bye,
bearophile
| |||
February 09, 2014 Re: wanna bitflags support | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | There is no bitfield support in dlang. Could you show any example? | |||
February 09, 2014 Re: wanna bitflags support | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Katayama Hirofumi MZ | On Sunday, 9 February 2014 at 13:48:08 UTC, Katayama Hirofumi MZ wrote:
> There is no bitfield support in dlang. Could you show any example?
std.bitmanip.bitfields should be able to do it.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply