Thread overview
wanna bitflags support
Feb 09, 2014
bearophile
Feb 09, 2014
Jakob Ovrum
February 09, 2014
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
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
There is no bitfield support in dlang. Could you show any example?
February 09, 2014
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.