Re: Add a precompiled c++ obj file to dub

2017-10-07 Thread user1234 via Digitalmars-d-learn
On Sunday, 8 October 2017 at 02:58:36 UTC, Fra Mecca wrote: On Saturday, 7 October 2017 at 23:54:50 UTC, user1234 wrote: On Saturday, 7 October 2017 at 19:56:52 UTC, Fra Mecca wrote: Hi all, I am writing a backend that is partly Vibe.d and partly clucene in c++. I have some object files

Re: Add a precompiled c++ obj file to dub

2017-10-07 Thread Fra Mecca via Digitalmars-d-learn
On Saturday, 7 October 2017 at 23:54:50 UTC, user1234 wrote: On Saturday, 7 October 2017 at 19:56:52 UTC, Fra Mecca wrote: Hi all, I am writing a backend that is partly Vibe.d and partly clucene in c++. I have some object files written in c++ and compiled with g++ that are not considered by

Re: Double ended arrays?

2017-10-07 Thread Ali Çehreli via Digitalmars-d-learn
On 10/07/2017 05:02 PM, Steven Schveighoffer wrote: > https://github.com/schveiguy/dcollections/blob/master/dcollections/Deque.d > > It's implemented by maintaining 2 dynamic arrays, one that is "reversed" > at the front, and one that is normal at the back. When you prepend, it > appends to

Re: Double ended arrays?

2017-10-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/7/17 3:38 AM, Chirs Forest wrote: I have some data that I want to store in a dynamic 2d array... I'd like to be able to add elements to the front of the array and access those elements with negative integers as well as add numbers to the back that I'd acess normally with positive

Re: Add a precompiled c++ obj file to dub

2017-10-07 Thread user1234 via Digitalmars-d-learn
On Saturday, 7 October 2017 at 19:56:52 UTC, Fra Mecca wrote: Hi all, I am writing a backend that is partly Vibe.d and partly clucene in c++. I have some object files written in c++ and compiled with g++ that are not considered by dub during the linking phase and throws `function undefined

Add a precompiled c++ obj file to dub

2017-10-07 Thread Fra Mecca via Digitalmars-d-learn
Hi all, I am writing a backend that is partly Vibe.d and partly clucene in c++. I have some object files written in c++ and compiled with g++ that are not considered by dub during the linking phase and throws `function undefined error ` every time. Is there a way to tell dub to let dmd

exclude members at compile time

2017-10-07 Thread Alex via Digitalmars-d-learn
Ok, what I'm trying to do is the following: take a type and a value of its type; given a known member of the type, (re?)create a similar type, without this very known member. What does work is this: /// --- code --- void main() { S s; s.i = 42; s.d = 73.0;

Re: Infuriating DUB/DMD build bug.

2017-10-07 Thread WhatMeForget via Digitalmars-d-learn
On Friday, 6 October 2017 at 23:02:56 UTC, Laeeth Isharc wrote: 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

Re: Implementing swap for user-defined swaps

2017-10-07 Thread ag0aep6g via Digitalmars-d-learn
On 10/07/2017 07:55 PM, Balagopal Komarath wrote:   I was implement my own range type that forwards all accesses to another range. I tried to write a `swap` function so that sort etc. could be called on my range. However, I cannot get `hasSwappableElements!ARange` to evaluate to true. But,

Re: @nogc formattedWrite

2017-10-07 Thread jmh530 via Digitalmars-d-learn
On Saturday, 7 October 2017 at 18:14:00 UTC, Nordlöw wrote: It would be nice to be able to formatted output in -betterC... Agreed. If you know the size of the buffer, you can use sformat, which might be @nogc, but I don't know if it's compatible with betterC. Also, you might check out

@nogc formattedWrite

2017-10-07 Thread Nordlöw via Digitalmars-d-learn
Is it currently possible to somehow do @nogc formatted output to string? I'm currently using my `pure @nogc nothrow` array-container `CopyableArray` as @safe pure /*TODO nothrow @nogc*/ unittest { import std.format : formattedWrite; const x = "42"; alias A = CopyableArray!(char);

Implementing swap for user-defined swaps

2017-10-07 Thread Balagopal Komarath via Digitalmars-d-learn
Hello, I was implement my own range type that forwards all accesses to another range. I tried to write a `swap` function so that sort etc. could be called on my range. However, I cannot get `hasSwappableElements!ARange` to evaluate to true. But, when I copy pasted the definition of

Re: DLL hell :S

2017-10-07 Thread Ian Hatch via Digitalmars-d-learn
On Saturday, 7 October 2017 at 15:30:30 UTC, rikki cattermole wrote: A little from column a, a little from column b, but most because he might be able to do something for you. Thanks, I'll send him an email.

Re: DLL hell :S

2017-10-07 Thread rikki cattermole via Digitalmars-d-learn
On 07/10/2017 4:29 PM, Ian Hatch wrote: On Saturday, 7 October 2017 at 15:14:01 UTC, rikki cattermole wrote: Email Walter directly. I intend to campaign for next years (basically a soft TODO list) plan for what we want done. But until then, he and Andrei need to hear that this is the biggest

Re: DLL hell :S

2017-10-07 Thread Ian Hatch via Digitalmars-d-learn
On Saturday, 7 October 2017 at 15:14:01 UTC, rikki cattermole wrote: Email Walter directly. I intend to campaign for next years (basically a soft TODO list) plan for what we want done. But until then, he and Andrei need to hear that this is the biggest limitation that D faces currently, not

Re: DLL hell :S

2017-10-07 Thread rikki cattermole via Digitalmars-d-learn
Email Walter directly. I intend to campaign for next years (basically a soft TODO list) plan for what we want done. But until then, he and Andrei need to hear that this is the biggest limitation that D faces currently, not memory management.

DLL hell :S

2017-10-07 Thread Ian Hatch via Digitalmars-d-learn
Hello! I'm Ian, and I've been a programmer in games for 10 years. I've been poking at D for a year or so and I'm absolutely in love with the compile-time execution and inline unit testing in particular. I've been trying for a while to set up a project that I intend to build a lot of my

Re: Need importing dcompute.lib into my project

2017-10-07 Thread kerdemdemir via Digitalmars-d-learn
On Saturday, 7 October 2017 at 12:12:10 UTC, kinke wrote: On Saturday, 7 October 2017 at 09:04:26 UTC, kerdemdemir wrote: Error: static assert "Need to use a DCompute enabled compiler" Are you using latest LDC 1.4? The CUDA backend wasn't enabled for earlier versions. Yes I am. Actually I

Re: Need importing dcompute.lib into my project

2017-10-07 Thread kinke via Digitalmars-d-learn
On Saturday, 7 October 2017 at 09:04:26 UTC, kerdemdemir wrote: Error: static assert "Need to use a DCompute enabled compiler" Are you using latest LDC 1.4? The CUDA backend wasn't enabled for earlier versions.

Re: Need importing dcompute.lib into my project

2017-10-07 Thread kerdemdemir via Digitalmars-d-learn
do you set "-mdcompute-targets=cuda-xxx" in the dflags for your dub.json for your project? I have added now after your comment. But it seems it didn't changed anything. Here is the dub.json file I have: { "name": "dsharpear", "authors": [ "Erdem" ],

Re: Need importing dcompute.lib into my project

2017-10-07 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 7 October 2017 at 09:04:26 UTC, kerdemdemir wrote: You should add DCompute as a DUB dependancy. Hi, I inited my project with Dub by unsing "dub init DSharpEar" and I added dependency "dcompute". Even I give extra parameters for using ldc. dub build

Re: Need importing dcompute.lib into my project

2017-10-07 Thread kerdemdemir via Digitalmars-d-learn
You should add DCompute as a DUB dependancy. Hi, I inited my project with Dub by unsing "dub init DSharpEar" and I added dependency "dcompute". Even I give extra parameters for using ldc. dub build --compiler=D:\LDCDownload\bin\ldc2.exe --force I am getting : Error: static assert

Re: Double ended arrays?

2017-10-07 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, October 07, 2017 07:38:47 Chirs Forest via Digitalmars-d-learn wrote: > I have some data that I want to store in a dynamic 2d array... > I'd like to be able to add elements to the front of the array and > access those elements with negative integers as well as add > numbers to the

Re: Double ended arrays?

2017-10-07 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 7 October 2017 at 07:38:47 UTC, Chirs Forest wrote: I have some data that I want to store in a dynamic 2d array... I'd like to be able to add elements to the front of the array and access those elements with negative integers as well as add numbers to the back that I'd acess

Double ended arrays?

2017-10-07 Thread Chirs Forest via Digitalmars-d-learn
I have some data that I want to store in a dynamic 2d array... I'd like to be able to add elements to the front of the array and access those elements with negative integers as well as add numbers to the back that I'd acess normally with positive integers. Is this something I can do, or do I