Re: function is not callable using argument types ()

2016-12-12 Thread Bauss via Digitalmars-d-learn
On Saturday, 10 December 2016 at 08:41:56 UTC, Suliman wrote: import std.stdio; import std.concurrency; void main() { void sp(int i) { receive((int i) { writeln("i: ", i); }); } auto r = new Generator!int( { foreach(i; 1 .

Re: function is not callable using argument types ()

2016-12-10 Thread Stefan Koch via Digitalmars-d-learn
On Saturday, 10 December 2016 at 08:41:56 UTC, Suliman wrote: import std.stdio; import std.concurrency; void main() { void sp(int i) { receive((int i) { writeln("i: ", i); }); } auto r = new Generator!int( { foreach(i; 1 .

Re: "function ... is not callable using argument types"

2015-01-01 Thread Ali Çehreli via Digitalmars-d-learn
On 01/01/2015 05:09 AM, Suliman wrote: But why variant: static const int PGSQL_UNITTEST_PORT = 5432; do not require of implicit convert to!short() at connection string? Walter Bright explains the reasons in his "Value Range Propagation" article: http://www.drdobbs.com/tools/value-range-prop

Re: "function ... is not callable using argument types"

2015-01-01 Thread bearophile via Digitalmars-d-learn
Suliman: But why variant: static const int PGSQL_UNITTEST_PORT = 5432; do not require of implicit convert to!short() at connection string? Because value range analysis now propagates the range even across expressions if they are const. It's a recent improvement to make the D compile a bit

Re: "function ... is not callable using argument types"

2015-01-01 Thread Tobias Pankrath via Digitalmars-d-learn
On Thursday, 1 January 2015 at 13:09:21 UTC, Suliman wrote: But why variant: static const int PGSQL_UNITTEST_PORT = 5432; do not require of implicit convert to!short() at connection string? As I said the compiler infers that 5432 is between short.min and short.max. Try it with something out

Re: "function ... is not callable using argument types"

2015-01-01 Thread Suliman via Digitalmars-d-learn
But why variant: static const int PGSQL_UNITTEST_PORT = 5432; do not require of implicit convert to!short() at connection string?

Re: "function ... is not callable using argument types"

2015-01-01 Thread Tobias Pankrath via Digitalmars-d-learn
So it's look like that it can accept strings and ints without problem. And I really can't understand why it's accept only "static const string" constructions... int does not implicitly convert to short. It does in the hardcoded version, because the compi