Named Global Arrays

Tofu Ninja via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 12 00:19:30 PDT 2014


On Tuesday, 12 August 2014 at 06:09:52 UTC, Tofu Ninja wrote:
> There might be a way to do it without Nullable but I couldn't
> think of one...

Ok I actually thought of a much better way to do it with out
Nullable...

struct namedGlobalArray(string name, T)
{
	public template opDispatch(string var)
	{
		alias opDispatch = arrayGlob!(name, var, T);
	}

}

private template arrayGlob(string arrayName, string varName, T)
{
	T arrayGlob;
}


More information about the Digitalmars-d mailing list