Prevent definition of non-disabled default constructors in template structs

This commit is contained in:
k-hara 2014-08-26 22:39:35 +09:00
parent 3a29f6dbad
commit d20e91ae01
2 changed files with 7 additions and 4 deletions

View file

@ -541,9 +541,9 @@ struct Task(alias fun, Args...)
enforce(this.pool !is null, "Job not submitted yet."); enforce(this.pool !is null, "Job not submitted yet.");
} }
private this(Args args) static if(Args.length > 0)
{ {
static if(args.length > 0) private this(Args args)
{ {
_args = args; _args = args;
} }

View file

@ -521,10 +521,13 @@ template Tuple(Specs...)
/** /**
* Constructor taking one value for each field. * Constructor taking one value for each field.
*/ */
static if (Types.length > 0)
{
this(Types values) this(Types values)
{ {
field[] = values[]; field[] = values[];
} }
}
/** /**
* Constructor taking a compatible array. * Constructor taking a compatible array.