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
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 .. 10)
yield(i);
});
I need to pass some config to ddbc driver. When I use static
const all work ok.
static const string PGSQL_UNITTEST_HOST = localhost;
static const intPGSQL_UNITTEST_PORT = 5432;
static const string PGSQL_UNITTEST_USER = postgres;
static const string PGSQL_UNITTEST_PASSWORD = Infinity8;
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
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
But why variant:
static const int PGSQL_UNITTEST_PORT = 5432;
do not require of implicit convert to!short() at connection
string?
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 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: