Re: COM2D Wrapper

2017-03-27 Thread evilrat via Digitalmars-d-learn
On Monday, 27 March 2017 at 21:02:05 UTC, Nierjerson wrote: On Friday, 24 March 2017 at 18:17:31 UTC, Nierjerson wrote: I'd like to present the following D library I am working on: https://github.com/IllusionSoftware/COM2D I get access violations when trying to call the functions on the

Re: how to define my own traits

2017-03-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 27 March 2017 at 21:18:31 UTC, XavierAP wrote: When I first read about inout as a device to obviate code duplication typical in C++ const ref overloads, I liked it but I assumed it was implemented by lowering it into the actual duplicate overloads. Though I'm not even sure right now

Re: how to define my own traits

2017-03-27 Thread XavierAP via Digitalmars-d-learn
On Monday, 27 March 2017 at 16:28:13 UTC, Gary Willoughby wrote: Even Andrei was baffled: http://forum.dlang.org/thread/nepm2k$311l$1...@digitalmars.com I see... And Walter went further and reported it as a DMD bug (still open clearly). It's what I mean. This strange behavior is more

Re: COM2D Wrapper

2017-03-27 Thread Nierjerson via Digitalmars-d-learn
On Friday, 24 March 2017 at 18:17:31 UTC, Nierjerson wrote: I'd like to present the following D library I am working on: https://github.com/IllusionSoftware/COM2D It attempts to automate COM in D. It has some problems but does partially work. Those with a recent version of Adobe Photoshop

Re: Loading assimp

2017-03-27 Thread Dlearner via Digitalmars-d-learn
On Sunday, 26 March 2017 at 21:52:42 UTC, ag0aep6g wrote: On 03/26/2017 11:31 PM, Dlearner wrote: SDL_Surface* surface = IMG_Load(filename.ptr); if (surface is null) { writeln("surface is null: ", to!string(IMG_GetError())); } else { writeln(filename); } From

Re: how to define my own traits

2017-03-27 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 26 March 2017 at 23:25:49 UTC, XavierAP wrote: I've looked into Phobos to emulate it when defining my own trait template, and when I see this: module std.range.primitives; // ... template isInputRange(R) { enum bool isInputRange = is(typeof( (inout int = 0) { R r

Re: Howto catch SocketOSException?

2017-03-27 Thread Jolly James via Digitalmars-d-learn
On Sunday, 26 March 2017 at 21:57:29 UTC, Jolly James wrote: On Sunday, 26 March 2017 at 18:50:13 UTC, bauss wrote: [...] If you want try to help me, mabye this helps you: https://github.com/CyberShadow/ae/blob/master/net/asockets.d#L1237 Finally found the bug: I had a logical error in the

Re: how to define my own traits

2017-03-27 Thread XavierAP via Digitalmars-d-learn
On Monday, 27 March 2017 at 00:49:14 UTC, Moritz Maxeiner wrote: Have you tried it without the dummy parameter on the example given in the bug report [2]? I see, thanks for finding it! Looks a bit hacky but I can live with it. Indeed if I remove the argument from Phobos, Martin's example

Re: Optimising JSON parsing leads to wierd execution timings

2017-03-27 Thread Seb via Digitalmars-d-learn
On Saturday, 25 March 2017 at 06:53:58 UTC, xtreak wrote: Hi, Sorry for the double post. I have asked a question at Stackoverflow regarding this : https://stackoverflow.com/questions/42992507/get-float-value-out-of-jsonvalue-in-dlang . I have a `rating` field that might have 3 which parses to