Larry Luther wrote:
Thanks guys.
Simen asked: "Is there a problem?".
Well, I kind of expected a "ubyte" buffer to be matched with a
"get(T:ubyte)".
I thought methods were searched for the "best" match.
No, C++ does it that way, and it gets horrendously complicated.
In D, it has to ma
Thanks guys.
Simen asked: "Is there a problem?".
Well, I kind of expected a "ubyte" buffer to be matched with a
"get(T:ubyte)".
I thought methods were searched for the "best" match.
Larry
On 06/08/2010 05:01 PM, Robert Clipsham wrote:
On 08/06/10 22:25, Larry Luther wrote:
Q: Is this the way it's supposed to be?
Yes, byte implicitly casts to ubyte so it's accepted. Try switching the
templates round, they will both be byte. The way around this is to add
template constraints to t
On 08/06/10 22:25, Larry Luther wrote:
Q: Is this the way it's supposed to be?
Yes, byte implicitly casts to ubyte so it's accepted. Try switching the
templates round, they will both be byte. The way around this is to add
template constraints to the templates:
void get(T:ubyte)(T[] buffer)
Larry Luther wrote:
get (T:ubyte)(T[] buffer)
get (T:ubyte)(T[] buffer)
get (T)(T[] buffer)
Q: Is this the way it's supposed to be?
Looks very much correct, yes. Is there a problem?
--
Simen
This code:
import std.stdio;
class A {
void get (T:ubyte)(T[] buffer) {
writefln( "get (T:ubyte)(T[] buffer)\n");
}
void get (T:byte)(T[] buffer) {
writefln( "get (T:byte)(T[] buffer)\n");
}
void get (T)(T[] buffer) {
writefln( "get (T)(T[] buffer)\n");
}
}
void main
Richard Webb wrote:
Hi,
While trying to get some things to build in D2, i noticed that the code:
import std.array;
void main (string[] args)
{
string s;
auto app = appender(&s);
app.put(['a', 'b']);
}
/
works, but if it's changed to;
char[
Richard Webb:
> char[2] tmp = ['a', 'b'];
> app.put(tmp);
>
> then it fails. Seems to be because char[2] isn't a forward range, so it
> doesn't match the version of put that takes a range.
>
> Is this a bug?
Maybe it's not a bug, but it's a limitation. With some more work on the
Appender then t
Hi,
While trying to get some things to build in D2, i noticed that the code:
import std.array;
void main (string[] args)
{
string s;
auto app = appender(&s);
app.put(['a', 'b']);
}
/
works, but if it's changed to;
char[2] tmp = ['a', 'b'];
a
Hi Steve,
On Mon, 07 Jun 2010 23:46:40 -0400, Steven Schveighoffer wrote:
> On Mon, 07 Jun 2010 23:02:48 -0400, Graham Fawcett
> wrote:
>
>> Hi folks,
>>
>> This program works as expected in D2:
>>
>> import std.stdio;
>> import std.algorithm;
>>
>> T largestSubelement(T)(T[][] lol)
On 08/06/10 13:12, Lars T. Kyllingstad wrote:
I don't know when you ordered it, but that has changed now, at least. At
amazon.co.uk it costs £18.50, while at amazon.com it sells for $42.70 --
roughly £29. Also, for Europeans, the delivery cost is lower if you
order from UK.
-Lars
I ordered i
On Tue, 08 Jun 2010 21:10:54 +0900, Masahiro Nakagawa wrote:
> On Tue, 08 Jun 2010 19:39:43 +0900, Simen kjaeraas
> wrote:
>
>> Simen kjaeraas wrote:
>>
>>> Lars T. Kyllingstad wrote:
>>>
FWIW, I've run across the same error, while writing code that had
nothing
to do with tuples
On Tue, 08 Jun 2010 19:39:43 +0900, Simen kjaeraas
wrote:
Simen kjaeraas wrote:
Lars T. Kyllingstad wrote:
FWIW, I've run across the same error, while writing code that had
nothing
to do with tuples. And I've seen others complaining about it too. It
seems to be a rather elusive bug
On Tue, 08 Jun 2010 13:00:51 +0100, Robert Clipsham wrote:
> On 08/06/10 11:23, Patrick Byrne wrote:
>> Amazon (UK) tells me that publication of this book is delayed. Is it
>> still coming soon, please?
>>
>> --
>> Patrick Byrne
>
> I ordered it from amazon.com, it was half the priceof the UK ver
On 08/06/10 11:23, Patrick Byrne wrote:
Amazon (UK) tells me that publication of this book is delayed. Is it
still coming soon, please?
--
Patrick Byrne
I ordered it from amazon.com, it was half the priceof the UK version ;)
I've had no delay message about it for a while now, the last one I g
On Tue, 08 Jun 2010 12:56:04 +0200, Simen kjaeraas wrote:
> Lars T. Kyllingstad wrote:
>> That's consistent with my experiences too. It seems to be triggered by
>> a Phobos unittest.
>>
>> Still, I can't reproduce it with your test case. Which DMD version are
>> you using?
>
> 2.045. Actually,
Lars T. Kyllingstad wrote:
That's consistent with my experiences too. It seems to be triggered by a
Phobos unittest.
Still, I can't reproduce it with your test case. Which DMD version are
you using?
2.045. Actually, I can't reproduce it now either. Ah, found the problem.
"dmd a b -unittest"
Lars T. Kyllingstad wrote:
I'm not sure I understand this. Do you then import a and b into another
module to reproduce the error? This doesn't do it for me...
As the bug report says: "dmd -unittest a b"
--
Simen
On Tue, 08 Jun 2010 12:39:43 +0200, Simen kjaeraas wrote:
> Simen kjaeraas wrote:
>
>> Lars T. Kyllingstad wrote:
>>
>>> FWIW, I've run across the same error, while writing code that had
>>> nothing
>>> to do with tuples. And I've seen others complaining about it too. It
>>> seems to be a rat
On Tue, 08 Jun 2010 12:31:50 +0200, Simen kjaeraas wrote:
> Lars T. Kyllingstad wrote:
>
>> FWIW, I've run across the same error, while writing code that had
>> nothing to do with tuples. And I've seen others complaining about it
>> too. It seems to be a rather elusive bug in Phobos.
>
> This
Simen kjaeraas wrote:
Lars T. Kyllingstad wrote:
FWIW, I've run across the same error, while writing code that had
nothing
to do with tuples. And I've seen others complaining about it too. It
seems to be a rather elusive bug in Phobos.
This has now been tracked down to the importing of
On Tue, 08 Jun 2010 11:23:23 +0100, Patrick Byrne wrote:
> Amazon (UK) tells me that publication of this book is delayed. Is it
> still coming soon, please?
I also ordered it from Amazon UK, and got the same message. But the book
is, as far as I know, finished and printed. So I suppose it's mo
Lars T. Kyllingstad wrote:
FWIW, I've run across the same error, while writing code that had nothing
to do with tuples. And I've seen others complaining about it too. It
seems to be a rather elusive bug in Phobos.
This has now been tracked down to the importing of std.typecons in two
includ
Amazon (UK) tells me that publication of this book is delayed. Is it still
coming soon, please?
--
Patrick Byrne
24 matches
Mail list logo