Re: Having trouble porting basic GLFW C++ example to D

2017-10-06 Thread Matt Jones via Digitalmars-d-learn
On Saturday, 7 October 2017 at 04:24:07 UTC, Matt Jones wrote: On Saturday, 7 October 2017 at 03:47:27 UTC, Joakim wrote: On Saturday, 7 October 2017 at 03:12:09 UTC, Matt Jones wrote: [...] Heh, that's the problem. [...] I ran into this myself, took me awhile to track it down. I too

Re: Having trouble porting basic GLFW C++ example to D

2017-10-06 Thread Matt Jones via Digitalmars-d-learn
On Saturday, 7 October 2017 at 03:47:27 UTC, Joakim wrote: On Saturday, 7 October 2017 at 03:12:09 UTC, Matt Jones wrote: [...] Heh, that's the problem. [...] I ran into this myself, took me awhile to track it down. I too took the size of dynamic arrays this way: [...] Ah. I should

Re: Having trouble porting basic GLFW C++ example to D

2017-10-06 Thread Joakim via Digitalmars-d-learn
On Saturday, 7 October 2017 at 03:12:09 UTC, Matt Jones wrote: I've been trying to port a basic GLFW C++ example to D. The C++ version shows the textures correctly. But the D version shows nothing. The code is almost identical. Heh, that's the problem. Does anyone know why the D version

Having trouble porting basic GLFW C++ example to D

2017-10-06 Thread Matt Jones via Digitalmars-d-learn
I've been trying to port a basic GLFW C++ example to D. The C++ version shows the textures correctly. But the D version shows nothing. The code is almost identical. Does anyone know why the D version does not work? https://github.com/workhorsy/d_glfw

Re: Infuriating DUB/DMD build bug.

2017-10-06 Thread Laeeth Isharc via Digitalmars-d-learn
On Thursday, 5 October 2017 at 21:48:20 UTC, WhatMeWorry wrote: I've got a github project and using DUB with DMD and I keep running into this problem. I've tried deleting the entire ...\AppData\Roaming\dub\packages folder, but the problem repeats the very next build attempt. [...] See my

Re: Need importing dcompute.lib into my project

2017-10-06 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 6 October 2017 at 18:12:43 UTC, kerdemdemir wrote: Hi, I have a cuda kernel already working in my cpp project(https://github.com/kerdemdemir/CUDABeamformer/blob/master/CudaBeamformer/kernel.cu) I am trying to convert this to D with using DCompute. I already compiled the DCompute

Re: template auto deduction

2017-10-06 Thread Alex via Digitalmars-d-learn
On Friday, 6 October 2017 at 21:42:40 UTC, Steven Schveighoffer wrote: What you need is IFTI or "Implicit Function Template Instantiation" Note the "Function" part of it, in that it's only valid for functions. So you need a factory function: auto m(T)(T x) { return M!(T)(x); } ...

Re: template auto deduction

2017-10-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/6/17 5:08 PM, Alex wrote: Hey, template gurus :) given this: struct M(alias I : S!E, alias S, E...) { R!E r; this(S)(S initStruct)    // line 4 {     r = R!E(initStruct); } } struct R(E...) { this(S)(S initStruct)    // line 12 {     // do some

Re: Iterating over functions in module in order?

2017-10-06 Thread Alex via Digitalmars-d-learn
On Thursday, 5 October 2017 at 00:24:12 UTC, Jerry wrote: Any ideas on how someone could iterate over functions in a module as they appear, rather than any random order, without having to manually label them? Do you mean something like this? /// --- code --- module test165; import

template auto deduction

2017-10-06 Thread Alex via Digitalmars-d-learn
Hey, template gurus :) given this: struct M(alias I : S!E, alias S, E...) { R!E r; this(S)(S initStruct)// line 4 { r = R!E(initStruct); } } struct R(E...) { this(S)(S initStruct)// line 12 { // do some cool

Re: dmd path handling is a bit dated

2017-10-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, October 06, 2017 20:11:25 Laeeth Isharc via Digitalmars-d-learn wrote: > And I'm posting here because we can submit a pull request, but I > didn't know whether to call Phobos or copy/paste as I haven't > submitted more than trivial doc changes to compiler. I've > written all of this

Re: dmd path handling is a bit dated

2017-10-06 Thread Laeeth Isharc via Digitalmars-d-learn
On Friday, 6 October 2017 at 20:11:25 UTC, Laeeth Isharc wrote: DMD path handling is a bit dated, and it's causing build I mean I imagine getcwd and tk/filespec.c might not be the only places that need updating, but I was going to start with those and see what happened.

dmd path handling is a bit dated

2017-10-06 Thread Laeeth Isharc via Digitalmars-d-learn
DMD path handling is a bit dated, and it's causing build problems for us because on Windows it's easy to end up breaking DMD's limit - particularly given how dub likes to turn everything into a relative path. Windows has so many beautiful example of the costs of legacy compat. I just wrote

Re: For fun: Expressive C++ 17 Coding Challenge in D

2017-10-06 Thread kerdemdemir via Digitalmars-d-learn
I am a total beginner but I want to post that a lot. auto autoCorrelation(R)(R range) if (isRandomAccessRange!R) { import std.numeric : fft, inverseFft; import std.range : chain, repeat, zip, dropBack; import std.algorithm : map; import std.complex;

Need importing dcompute.lib into my project

2017-10-06 Thread kerdemdemir via Digitalmars-d-learn
Hi, I have a cuda kernel already working in my cpp project(https://github.com/kerdemdemir/CUDABeamformer/blob/master/CudaBeamformer/kernel.cu) I am trying to convert this to D with using DCompute. I already compiled the DCompute source code and have dcompute.lib. But I am really not good

Re: Infuriating DUB/DMD build bug.

2017-10-06 Thread Mike Parker via Digitalmars-d-learn
On Friday, 6 October 2017 at 09:12:09 UTC, Mike Parker wrote: On Thursday, 5 October 2017 at 21:48:20 UTC, WhatMeWorry wrote: AppData/Roaming/dub/packages, create a new directory off C: (say, C:\dub, manually fetch the packages you need into that directory and use `dub add-local` on them

Re: Infuriating DUB/DMD build bug.

2017-10-06 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 5 October 2017 at 21:48:20 UTC, WhatMeWorry wrote: With writing files, that's usually a permissions thing? But all the other 8 packages build fine? Note: I had a similar problem with derelict-assimp3 package, so I went to an entirely different system and cloned my project.