...without having to loop over the enum?
enum SomeType : string { CHEESE = "cheese", POTATO = "potato" }
string valid_value = "cheese";
string invalid_value = "pizza";
bool test( string value ){
if( value.isConvertableToSomeType ){ // this be the magic I
seek
//do something
On Monday, 21 September 2015 at 19:23:38 UTC, cym13 wrote:
On Monday, 21 September 2015 at 16:32:25 UTC, French Football
wrote:
[...]
I had to look into phobos sources
(/usr/include/dlang/dmd/std/containers/dlist.d) to find a
unittest, and judging from it it seems inserting in the middle
Going through a book on coding in D,
http://ddili.org/ders/d.en/foreach.html , I find the following
very useful feature:
When two names are specified in the names section [with a plain
array], they represent an automatic counter and the value of the
element, respectively:
foreach (i,
On Monday, 21 September 2015 at 15:54:06 UTC, Justin Whear wrote:
On Monday, 21 September 2015 at 15:58:12 UTC, cym13 wrote:
Thankyou! .enumerate lets me iterate over a container with a
counter.
--Related tangential question... If I have a DList, how do I
insert into the middle of it?