On 21.04.2016 04:35, Alex Parrill wrote:
On Wednesday, 20 April 2016 at 22:44:37 UTC, ag0aep6g wrote:
On 20.04.2016 23:59, Alex Parrill wrote:
[...]
That's not assigning the elements of a void[]; it's just changing what
the slice points to and adjusting the length, like doing `void* ptr =
On Wednesday, 20 April 2016 at 22:44:37 UTC, ag0aep6g wrote:
On 20.04.2016 23:59, Alex Parrill wrote:
On Wednesday, 20 April 2016 at 17:09:29 UTC, Matt Kline wrote:
[...]
First, you can't assign anything to a void[], for the same
reason you
can't dereference a void*. This includes the slice
On 20.04.2016 23:59, Alex Parrill wrote:
On Wednesday, 20 April 2016 at 17:09:29 UTC, Matt Kline wrote:
[...]
First, you can't assign anything to a void[], for the same reason you
can't dereference a void*. This includes the slice assignment that you
are trying to do in `buf[0..minLen] =
On Wednesday, 20 April 2016 at 17:09:29 UTC, Matt Kline wrote:
[...]
First, you can't assign anything to a void[], for the same reason
you can't dereference a void*. This includes the slice assignment
that you are trying to do in `buf[0..minLen] =
remainingData[0..minLen];`.
Cast the
On 20.04.2016 22:09, Matt Kline wrote:
I'd rather not write my own cURL wrapper. Do you think it would be
worthwhile starting a PR for Phobos to get it changed to ubyte[]? A
reading of https://dlang.org/spec/arrays.html indicates the main
difference is that that GC crawls void[], but I would
On Wednesday, 20 April 2016 at 20:00:58 UTC, ag0aep6g wrote:
Maybe I've missed it, but you didn't say where the HTTP type
comes from, did you?
std.net.curl: https://dlang.org/phobos/std_net_curl.html#.HTTP
(Sorry, I assumed that was a given since it's a standard library
type. Poor
On 20.04.2016 21:48, Matt Kline wrote:
I don't have an option here, do I? I assume HTTP.onSend doesn't take a
`delegate size_t(ubyte[])` insetad of a `delegate size_t(void[])`, and
that the former isn't implicitly convertible to the latter.
Maybe I've missed it, but you didn't say where the
On Wednesday, 20 April 2016 at 19:29:22 UTC, ag0aep6g wrote:
Maybe use ubyte[] for the buffer type instead.
I don't have an option here, do I? I assume HTTP.onSend doesn't
take a `delegate size_t(ubyte[])` insetad of a `delegate
size_t(void[])`, and that the former isn't implicitly
On 20.04.2016 19:09, Matt Kline wrote:
1. What is the idiomatic way to constrain the function to only take char
ranges? One might naïvely add `is(ElementType!T : char)`, but that falls
on its face due to strings "auto-decoding" their elements to dchar.
(More on that later.)
Well, string is not
On Wednesday, 20 April 2016 at 17:09:29 UTC, Matt Kline wrote:
I'm doing some work with a REST API, and I wrote a simple
utility function that sets an HTTP's onSend callback to send a
string:
[...]
IO functions usually work with octets, not characters, so an
extra encoding step is needed.
10 matches
Mail list logo