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 .
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 .
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
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
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
But why variant:
static const int PGSQL_UNITTEST_PORT = 5432;
do not require of implicit convert to!short() at connection
string?
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