On 3/8/18 3:29 AM, Shachar Shemesh wrote:
On 07/03/18 17:11, Steven Schveighoffer wrote:
Well, you could do it with templates, but obviously that is less
desirable:
void func2(Args...)(Args args) if(is(typeof(func(args { return
func(args); }
I never understood why anyone would use "is"
On 07/03/18 17:11, Steven Schveighoffer wrote:
Well, you could do it with templates, but obviously that is less desirable:
void func2(Args...)(Args args) if(is(typeof(func(args { return
func(args); }
I never understood why anyone would use "is" for checking compilability
when we have "__
On 07.03.2018 18:23, Jonathan M Davis wrote:
However, even doing something like
auto func2(Parameters!func args = AliasSeq!(1, 2, 3))
{
return func(args);
}
doesn't work properly. If that version of the function is used, then the
call which passes all three arguments compiles, but the oth
On Wednesday, March 07, 2018 18:59:51 Shachar Shemesh via Digitalmars-d
wrote:
> On 07/03/18 16:42, Jonathan M Davis wrote:
> > AFAIK, there's no way to get the values of default arguments with type
> > inferrence
>
> I used that way right there in the code. ParameterDefaults!func return a
> tuple
On 07/03/18 16:42, Jonathan M Davis wrote:
AFAIK, there's no way to get the values of default arguments with type
inferrence
I used that way right there in the code. ParameterDefaults!func return a
tuple with the arguments. The problem is that "Tuple var = Tuple" does
not work. Different erro
On 3/7/18 9:20 AM, Shachar Shemesh wrote:
import std.traits;
import std.stdio;
void func(int a, int b=2, int c=3) {
return a+b+c;
}
void func2(Parameters!func args = ParameterDefaults!func) {
return func(args);
}
void main() {
writeln(func2(1));
writeln(func2(1,1));
wr
On Wednesday, March 07, 2018 16:20:19 Shachar Shemesh via Digitalmars-d
wrote:
> import std.traits;
> import std.stdio;
>
> void func(int a, int b=2, int c=3) {
> return a+b+c;
> }
>
> void func2(Parameters!func args = ParameterDefaults!func) {
> return func(args);
> }
>
> void main() {
import std.traits;
import std.stdio;
void func(int a, int b=2, int c=3) {
return a+b+c;
}
void func2(Parameters!func args = ParameterDefaults!func) {
return func(args);
}
void main() {
writeln(func2(1));
writeln(func2(1,1));
writeln(func2(1,1,1));
}
So, this does not compil