[Issue 6921] Request for a 'static final switch' statement

2016-10-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6921

Andrei Alexandrescu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||and...@erdani.com
 Resolution|--- |WONTFIX

--


[Issue 6921] Request for a 'static final switch' statement

2016-08-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6921

teddybear12...@gmail.com changed:

   What|Removed |Added

 CC||teddybear12...@gmail.com

--- Comment #2 from teddybear12...@gmail.com ---
It would also be nice to have a static final switch on a type tuple.
Essentially every type in the type tuple must have an equivalent case. I've ran
across a few bugs in my code due to the fact that I forgot a static if (T ==
sometype). It just fails silently. This happens when new types are added.

--


[Issue 6921] Request for a 'static final switch' statement

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6921

Tanel Tagaväli  changed:

   What|Removed |Added

 CC||tane...@hotmail.com

--


[Issue 6921] Request for a 'static final switch' statement

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6921

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|unspecified |D2

--


[Issue 6921] Request for a 'static final switch' statement

2014-07-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6921

Vlad Levenfeld vlevenf...@gmail.com changed:

   What|Removed |Added

 CC||vlevenf...@gmail.com

--


[Issue 6921] Request for a 'static final switch' statement

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6921


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2012-05-27 05:54:55 PDT ---
Do you mean something like this? It's handy:


enum Options {
Some, Many, All
}

class OptionManager(Options opt) {
static final switch(opt) {
case Options.Some:
alias TypeTuple!(int) TP;
break;
case Options.Many:
alias TypeTuple!(int, int, int) TP;
break;
case Options.All:
alias TypeTuple!(int, int, int, int, int, int) TP;
break;
}

public this(TP params) {
// ...
}
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---