Can I make this work?

Kagamin spam at here.lot
Sat Mar 20 07:19:23 UTC 2021


struct S
{
	this(string s)
	{
		type = Type.type1;
	}

	this(int n)
	{
		type = Type.type2;
	}

	Type type;
	int n;
}

int value(S s)()
{
	static if(s.type == Type.type2) {
		// do something
	}

	return n;
}



More information about the Digitalmars-d-learn mailing list