[phobos] review for environment

Michel Fortin michel.fortin at michelf.com
Thu Nov 4 05:37:48 PDT 2010


Le 2010-11-04 à 6:34, Jonathan M Davis a écrit :

> Regardless, I think that using a final, uninstantiatable class is the best way to create a namespace within a module in D at the moment.

It does pollute the object code with a useless vtable and ClassInfo object though. As long as there aren't too many of them it's probably fine.

Another way to achieve what you want would be:

	template X() {
		void func();
	}
	mixin X x;

	// now you can do
	x.func();

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the phobos mailing list