On Thursday, 15 August 2013 at 00:57:26 UTC, Tommi wrote:
...
And half the time I say "converted to int[]" I mean "converted to
uint[]" and the other half of the time I mean "converted to
char[]". Sorry about that.
On Thursday, 15 August 2013 at 01:05:54 UTC, Tommi wrote:
On Thursday, 15 August 2013 at 00:57:26 UTC, Tommi wrote:
...
And half the time I say "converted to int[]" I mean "converted
to uint[]" and the other half of the time I mean "converted to
char[]". Sorry about that.
Actually that's n
On Thursday, August 15, 2013 02:57:25 Tommi wrote:
> Thus, my point is this:
> Shouldn't this magical property of static arrays (implicitly
> converting to dynamic array during type deduction) extend to all
> type deduction situations?
No. If anything, we should get rid of the implicit conversion
On Thursday, 15 August 2013 at 00:57:26 UTC, Tommi wrote:
Static array types are somewhat magical in D; they can do
something that no other non-subtype type can do: static arrays
can implicitly convert to another type during type deduction.
More specifically, e.g. int[3] can implicitly conver
On Thursday, 15 August 2013 at 02:30:54 UTC, Jonathan M Davis
wrote:
On Thursday, August 15, 2013 02:57:25 Tommi wrote:
Thus, my point is this:
Shouldn't this magical property of static arrays (implicitly
converting to dynamic array during type deduction) extend to
all
type deduction situation
On Thursday, 15 August 2013 at 02:30:54 UTC, Jonathan M Davis
wrote:
On Thursday, August 15, 2013 02:57:25 Tommi wrote:
Thus, my point is this:
Shouldn't this magical property of static arrays (implicitly
converting to dynamic array during type deduction) extend to
all
type deduction situation
On Thursday, 15 August 2013 at 02:30:54 UTC, Jonathan M Davis
wrote:
No. If anything, we should get rid of the implicit conversion
from a static
array to a dynamic one. It's actually unsafe to do so. It's
just like if you
implicitly converted a local variable to the address of that
local variab
On Thursday, 15 August 2013 at 07:16:01 UTC, Maxim Fomin wrote:
On Thursday, 15 August 2013 at 00:57:26 UTC, Tommi wrote:
Static array types are somewhat magical in D; they can do
something that no other non-subtype type can do: static arrays
can implicitly convert to another type during type
On Thursday, 15 August 2013 at 12:12:59 UTC, Tommi wrote:
Implicit conversion VS Implicit conversion during type deduction
I don't think that you failed to see the distinction between
these two things, but because someone might, I
On 08/15/13 14:44, Tommi wrote:
[...]
> No, I'm not asking A -> C, I'm just asking that int[3] convert to int[].
>From you earlier post:
Ret bar(R)(R r) // [6]
if (std.range.isInputRange!R)
{
return Ret.input_range;
}
You'd like to be able to call 'bar' with a static array. Current
On Thursday, 15 August 2013 at 12:44:09 UTC, Tommi wrote:
I don't expect int[3] to implicitly convert to int[] during
type deduction for the same reason that I don't expect int to
implicitly convert to long during type deduction (even though I
know that int implicitly converts to long in all
On Thursday, 15 August 2013 at 13:25:58 UTC, Maxim Fomin wrote:
On Thursday, 15 August 2013 at 12:12:59 UTC, Tommi wrote:
Implicit conversion VS Implicit conversion during type
deduction
I don't think that you failed to see the
On Thursday, 15 August 2013 at 13:50:45 UTC, Maxim Fomin wrote:
On Thursday, 15 August 2013 at 12:44:09 UTC, Tommi wrote:
I don't expect int[3] to implicitly convert to int[] during
type deduction for the same reason that I don't expect int to
implicitly convert to long during type deduction
On Thursday, 15 August 2013 at 13:53:17 UTC, Artur Skawina wrote:
On 08/15/13 14:44, Tommi wrote:
[...]
No, I'm not asking A -> C, I'm just asking that int[3] convert
to int[].
From you earlier post:
Ret bar(R)(R r) // [6]
if (std.range.isInputRange!R)
{
return Ret.input_range;
On Thursday, 15 August 2013 at 14:32:29 UTC, Tommi wrote:
No it's not:
void getLong(T)(T arg)
if (is(T : long))
{
static assert(is(typeof(arg) == int));
}
void main()
{
int n;
getLong(n); // int is _not_ implicitly converted to long
}
Yes, because during type deduction there was
On Thursday, 15 August 2013 at 14:53:08 UTC, Maxim Fomin wrote:
On Thursday, 15 August 2013 at 14:32:29 UTC, Tommi wrote:
No it's not:
void getLong(T)(T arg)
if (is(T : long))
{
static assert(is(typeof(arg) == int));
}
void main()
{
int n;
getLong(n); // int is _not_ implicitly conve
On Thursday, 15 August 2013 at 15:07:23 UTC, Tommi wrote:
The only time when the compiler is willing to consider the
possible implicit conversions during type deduction is with
static arrays: hence... "magic".
Barring this special case which I mentioned in my original post:
On Thursday, 15 Au
17 matches
Mail list logo