2013-01-25 01:21:03 |
Matt Jones |
description |
Functions work like this:
public bool to_bool(string value) {
return value=="true" || value=="1";
}
But they need to be changed to work with other string types:
public bool to_bool(S)(S value) {
return value=="true" || value=="1";
} |
Functions work like this:
public bool to_bool(string value) {
return value=="true" || value=="1";
}
But they need to be changed to work with other string types:
public bool to_bool(S)(S value)
if(isSomeString!S) {
return value=="true" || value=="1";
} |
|