Re: What exactly does the compiler switch -betterC do?

2016-09-26 Thread Gary Willoughby via Digitalmars-d-learn
On Tuesday, 20 September 2016 at 13:23:35 UTC, Jacob Carlborg wrote: On 2016-09-19 23:09, Gary Willoughby wrote: $ rdmd --build-only --force -betterC -de -O -inline -release -w test.d $ nm test Indeed. I just noticed now that there's a difference between 2.070.0 and 2.071.0. I get 4

Re: Proper way to work around `Invalid memory operation`?

2016-09-26 Thread ketmar via Digitalmars-d-learn
On Monday, 26 September 2016 at 09:43:02 UTC, Nemanja Boric wrote: On Sunday, 25 September 2016 at 16:07:12 UTC, Matthias Klumpp wrote: At time, I work around this bug by calling close() manually at the appropriate time, but this feel like a rather poor solution. Cheers, Matthias

Re: Proper way to work around `Invalid memory operation`?

2016-09-26 Thread Nemanja Boric via Digitalmars-d-learn
On Sunday, 25 September 2016 at 16:07:12 UTC, Matthias Klumpp wrote: At time, I work around this bug by calling close() manually at the appropriate time, but this feel like a rather poor solution. Cheers, Matthias That's not a poor solution, but rather a much better solution if you rely

Re: Vibe.d help

2016-09-26 Thread Martin Tschierschke via Digitalmars-d-learn
On Friday, 23 September 2016 at 21:32:59 UTC, Gestalt Theory wrote: On Thursday, 22 September 2016 at 09:14:46 UTC, Martin Tschierschke wrote: On Thursday, 22 September 2016 at 01:38:12 UTC, Gestalt Theory wrote: 3. How to serve static files properly? sendFile(req, res, Path(req.path));

Re: how to access struct member using [] operator?

2016-09-26 Thread pineapple via Digitalmars-d-learn
On Sunday, 25 September 2016 at 16:07:59 UTC, Basile B. wrote: WooW I have to say that I'm mesmerized ! How can this works ? "member" is run time variable so the return type shouldn't be inferable. The int fields are promoted to and returned as floats.

Re: how to access struct member using [] operator?

2016-09-26 Thread ZombineDev via Digitalmars-d-learn
On Sunday, 25 September 2016 at 04:54:31 UTC, grampus wrote: Dear all For example, I have a struct struct point{int x;int y} point a; Is there an easy way to access x and y by using a["x"] and a["y"] I guess I need to overload [], but can't figure out how. Someone can help? Thank you very

Re: Easy sockets - don't exist yet?

2016-09-26 Thread haxx via Digitalmars-d-learn
On Monday, 26 September 2016 at 23:40:10 UTC, Vincent wrote: Hello, guys! I was very surprised that module 'socketstream' was deprecated. Usually if something become obsolete, there is some perfect replacement! But my digging in Inet and forums gave nothing, but "outdated" examples with

Easy sockets - don't exist yet?

2016-09-26 Thread Vincent via Digitalmars-d-learn
Hello, guys! I was very surprised that module 'socketstream' was deprecated. Usually if something become obsolete, there is some perfect replacement! But my digging in Inet and forums gave nothing, but "outdated" examples with 'SocketStream' class. So first question is WHAT Phobos has to