How to import for mixin contents only.

Taylor Hillegeist via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 9 20:07:54 PST 2016


So i want bitfields for just a little bit. but i dont want its 
dependencies. How is it done. I have tried this. but it doesnt 
seem to work on gdc. :(

struct Color_t {
	static if(__ctfe){
		import std.bitmanip:bitfields;
	}
	mixin(bitfields!(
		uint, "R",    8,
		uint, "G",   8,
		uint, "B",    8,
		uint, "A", 8));
}


More information about the Digitalmars-d-learn mailing list