std.typecons rebindable + tuple with const class gives warning

2021-02-04 Thread Saurabh Das via Digitalmars-d-learn
This code: void main() { import std.typecons : rebindable, tuple; const c = new C(); auto t = tuple(c.rebindable); } class C { } When compiled with DMD 2.095.0 gives a warning: Warning: struct Rebindable has method toHash, however it cannot be called with const(Rebindable!(const(C

Re: std.net.curl and HTTP.responseHeaders

2021-02-04 Thread Anonymouse via Digitalmars-d-learn
On Wednesday, 3 February 2021 at 19:25:18 UTC, Vindex wrote: Output: ``` std.net.curl.HTTPStatusException@/usr/include/dmd/phobos/std/net/curl.d(1097): HTTP request returned status code 405 () ``` Perhaps some special HTTP configuration is needed? Is this closer to what you want? import std.

Re: std.net.curl and HTTP.responseHeaders

2021-02-04 Thread Vindex via Digitalmars-d-learn
Thank you! For other sites, the first solution somehow worked (I did it following the example from the documentation).

Re: std.typecons rebindable + tuple with const class gives warning

2021-02-04 Thread tsbockman via Digitalmars-d-learn
On Thursday, 4 February 2021 at 08:16:06 UTC, Saurabh Das wrote: This code: void main() { import std.typecons : rebindable, tuple; const c = new C(); auto t = tuple(c.rebindable); } class C { } When compiled with DMD 2.095.0 gives a warning: Warning: struct Rebindable has method t

Re: My simple internet client made in Dlang.

2021-02-04 Thread Ali Çehreli via Digitalmars-d-learn
On 2/3/21 8:44 AM, Marcone wrote: relevant opinion I think the following would be improvements: >char[8192] request; I don't know the protocol but obviously 8192 must be sufficient. >auto rq = c.receive(request); So, what is actually received is request[0..rq]. I would call the firs

Re: My simple internet client made in Dlang.

2021-02-04 Thread Max Haughton via Digitalmars-d-learn
On Thursday, 4 February 2021 at 20:54:15 UTC, Ali Çehreli wrote: On 2/3/21 8:44 AM, Marcone wrote: [...] I think the following would be improvements: >[...] I don't know the protocol but obviously 8192 must be sufficient. [...] Less calls to std.conv can also mean less surface area fo