www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Feature request: getMembers

Feature request: Could the d2.0 method 'classinfo::getMembers' be  
implemented please. Or is this a bug?

module test;

import std.stdio;

class Thing
{
	int abcd;
	this()
	{
		
	}
}

int main(char[][] args)
{
	Thing t = new Thing();
	MemberInfo[] members = cast(MemberInfo[])t.classinfo.getMembers(null);
	write(t.classinfo.name~" has members: ");
	writeln(members.length);
	foreach(MemberInfo mi; members)
	{
		writeln(mi.name());	
	}
	return 0;
}
Dec 21 2008