Skip to content

Commit

Permalink
no need to use parameter names to get defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Oct 15, 2016
1 parent 2090d33 commit ac7cc67
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions std/traits.d
Expand Up @@ -1206,11 +1206,7 @@ template ParameterDefaults(func...)
{
template Get(size_t i)
{
enum ParamName = ParameterIdentifierTuple!(func[0])[i];
static if (ParamName.length)
enum get = (PT[i..i+1]) => mixin(ParamName);
else // Unnamed parameter
enum get = (PT[i..i+1] __args) => __args[0];
enum get = (PT[i..i+1] __args) => __args[0];
static if (is(typeof(get())))
enum Get = get();
else
Expand Down

0 comments on commit ac7cc67

Please sign in to comment.