static foreach / iterate over all consts in a module?

Robert M. Münch robert.muench at saphirion.com
Sun Mar 3 19:20:00 UTC 2019


If I want to iterate over all const WM_* windows message definitions 
during compile time, can this be done with a static foreach and the 
allMembers traits?

Something like:

static foreach(wm; __traits(allMembers, mymodule)) {
	static if(wm[1..3] == "WM_") {


-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d mailing list