D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5520 - bitfieldsOn
Summary: bitfieldsOn
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Linux
: P2 enhancement
Assignee: Era Scarecrow
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-02 17:54 UTC by Ellery Newcomer
Modified: 2020-03-21 03:56 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ellery Newcomer 2011-02-02 17:54:23 UTC
I think it would be nice to have a variation of bitfields which generates operations on a preexisting field, e.g.

struct Z{
 Foobar f;
 mixin(bitfieldsOn!("f.squirt.honk"
                    bool, "buzz",1,
                    uint, "fuzz",7,
 ));
}
Comment 1 Era Scarecrow 2012-08-01 08:10:33 UTC
Current branch adds the feature. I do see it as useful. Once current pull is accepted, this will be resolved.

https://github.com/rtcvb32/phobos/commit/620ba57cc0a860245a2bf03f7b7f5d6a1bb58312
Comment 2 yebblies 2012-10-27 09:46:58 UTC
Could you add a link to the pull request you're talking about?  Same for issue 4935.
Comment 3 safety0ff.bugz 2013-10-05 09:24:46 UTC
He seems to have been referring to pull requests: 1045, 719, 734 and 740 (all closed unmerged.)
Comment 4 Andrej Mitrovic 2014-04-29 15:43:20 UTC
Couldn't you use a union for this?
Comment 5 basile-z 2015-11-21 13:53:16 UTC
implemented in https://github.com/rtcvb32/phobos/pull/1/files