I have a named enum that I'd like to keep named, that I'd like to
use as a type, but every time I use a member I'd rather not write
out the enum name. I have a situation like the following:
enum PolygonT : byte { TRIANGLE, RECTANGLE, STAR }
void someFunc(PolygonT shape) { //some stuff }
I'd l
On Saturday, 15 August 2015 at 15:37:42 UTC, QuizzicalFella wrote:
I'd like to be able to call someFunc(TRIANGLE) rather than
someFunc(PolygonT.TRIANGLE).
Two options come to mind:
alias TRIANGLE = PolygonT.TRIANGLE;
// etc
Or at the usage site:
with(PolygonT) {
someFunc(TRIANGLE);
}
I
On Saturday, 15 August 2015 at 15:53:23 UTC, Adam D. Ruppe wrote:
On Saturday, 15 August 2015 at 15:37:42 UTC, QuizzicalFella
wrote:
I'd like to be able to call someFunc(TRIANGLE) rather than
someFunc(PolygonT.TRIANGLE).
Two options come to mind:
alias TRIANGLE = PolygonT.TRIANGLE;
// etc
..
On 08/15/2015 09:22 AM, QuizzicalFella wrote:
On Saturday, 15 August 2015 at 15:53:23 UTC, Adam D. Ruppe wrote:
On Saturday, 15 August 2015 at 15:37:42 UTC, QuizzicalFella wrote:
I'd like to be able to call someFunc(TRIANGLE) rather than
someFunc(PolygonT.TRIANGLE).
Two options come to mind: