Hi
When I try to build the following:
import std.algorithm.iteration;
void test(int[] array);
void main()
{
int[] a = [1,1,2,2,3,3];
foreach (p; a.permutations)
{
test(p);
}
}
I get the error:
.\permutations_example.d(10): Error: function
perm
Interesting info, I've never seen this behavior in C since the
conversion is implicit as [2] notes. A simple cast resolves the
problem in D:
module main;
int main(string[] argv){
short asd = 1;
short qwe = cast(short)(asd + asd);
return 0;
}
Thanks for your answer :)
Hello
I'm trying to compile the following program:
module main;
int main(string[] argv){
short asd = 1;
short qwe = asd + asd;
return 0;
}
And the compiler gives this error:
C:\David>dmd simple
simple.d(5): Error: cannot implicitly convert expression
(cast(int)asd + c