On Friday, 30 December 2016 at 13:45:23 UTC, Martin wrote:
Are there any C-like bitfields in D?
Yes - How can I use them?
No - What could be used in their stead?
If you're okay with dependencies and if you use DUB there's this
very decent wrapper called EnumSet:
- https://code
On Friday, 30 December 2016 at 14:06:06 UTC, Marc Schütz wrote:
On Friday, 30 December 2016 at 13:45:23 UTC, Martin wrote:
Are there any C-like bitfields in D?
Yes - How can I use them?
No - What could be used in their stead?
Not built-in, but in the standard library:
https://dlang.org
On Friday, 30 December 2016 at 13:45:23 UTC, Martin wrote:
Are there any C-like bitfields in D?
Yes - How can I use them?
No - What could be used in their stead?
Not built-in, but in the standard library:
https://dlang.org/phobos/std_bitmanip.html#.bitfields
Are there any C-like bitfields in D?
Yes - How can I use them?
No - What could be used in their stead?
On 05/13/12 23:01, David Nadlinger wrote:
> Yes, the getters and setters should be both pure and nothrow.
>
> Your question about purity actually roots in a quite common
> misunderstanding – I have a pretty comprehensive article on the
> topic in the pipe, hope to be able to finish it later this w
On 13-05-2012 21:51, Guillaume Chatelet wrote:
Sure enough bitfields is a strange beast and I ran into some subtleties
with purity and nothrow.
Consider the following code :
--
struct POD {
int a;
}
int getA(POD o) pure nothrow {
return o.a;
}
POD setA(POD
On Sunday, 13 May 2012 at 20:49:13 UTC, Guillaume Chatelet wrote:
IMHO getters and setters could be nothrow but what about
purity? Looks
like it's a bit far-fetched to qualify member methods as pure
right?
Yet it makes sense regarding the semantic. What's your take on
that?
Yes, the getters a
Sure enough bitfields is a strange beast and I ran into some subtleties
with purity and nothrow.
Consider the following code :
--
struct POD {
int a;
}
int getA(POD o) pure nothrow {
return o.a;
}
POD setA(POD o, int value) pure nothrow {
o.a = value
Andrei Alexandrescu:
> Sounds good. Did you have a chance to enter that into bugzilla?
Done:
http://d.puremagic.com/issues/show_bug.cgi?id=4425
Bye,
bearophile
bearophile wrote:
This blog post shows possible ideas to make std.bitmanip.bitfields more
complete:
http://potential-lang.org/2010/07/02/quasi-quoting-ascii-art-to-define-data-structures/
An example of the ideas:
struct IntDesc_t {
...
immutable IST : 3 = 0;
immutable Unused0 : 5 = 0;
i
phile
How is this different from erlang's bitfields, aside from the
mutable/immutable part?
This blog post shows possible ideas to make std.bitmanip.bitfields more
complete:
http://potential-lang.org/2010/07/02/quasi-quoting-ascii-art-to-define-data-structures/
An example of the ideas:
struct IntDesc_t {
...
immutable IST : 3 = 0;
immutable Unused0 : 5 = 0;
immutable type : 4 =
12 matches
Mail list logo