On Monday, 23 October 2017 at 12:41:09 UTC, Márcio Martins wrote:
What is everyone doing to get proper file name and line number
info for callstacks with DMD?
addr2line just gives me ??:0
You could try compiling with the -debug-switch. Of course if this
turns out to be the fix, it doesn't he
I am trying to create a generic interface to arrays. Most
operations except those on elements of slices.
Code:
class Table(T) {
T[] data;
this(T[] data) {
this.data = data;
}
auto ref opSlice(size_t x, size_t y) {
return new Tabl
On Thursday, 21 January 2016 at 11:15:22 UTC, abad wrote:
I am trying to create a generic interface to arrays. Most
operations except those on elements of slices.
Code:
class Table(T) {
T[] data;
this(T[] data) {
this.data = data;
}
auto ref op
Let's say I have an array like this:
int[][][] array;
And I want to generate a linear int[] based on its data. Is there
a standard library method for achieving this, or must I iterate
over the array manually?
What I'm thinking of is something like this:
int[] onedim = std.array.collapse(arr
On Monday, 25 January 2016 at 02:27:57 UTC, Solomon E wrote:
On Saturday, 23 January 2016 at 07:57:55 UTC, Ali Çehreli wrote:
auto collapse(R)(R r)
if (isArray!R) {
return r.joiner.collapse.joiner;
}
auto collapse(R)(R r)
if (!isArray!R) {
return r;
}
Ali, that code
I have a project which is a mixture of D, C++ and C. I have used
Make for build automation so far but would like to migrate to DUB.
I have hard time figuring out what to do with C / C++ sections of
the program. DUB seems to ignore (probably sensibly) everything
but D source files. I compiled a
D source:
extern(C++) void thisWorks(const char* test);
extern(C++) void doesNotLink(const char** test);
void main() {
char* baz1;
char** baz2;
thisWorks(baz1);
doesNotLink(baz2);
}
CPP source:
#include
void thisWorks(const char* test) {
printf("hi\n");
}
void DoesNotLin
On Wednesday, 1 June 2016 at 07:17:04 UTC, Mike Parker wrote:
On Wednesday, 1 June 2016 at 07:09:16 UTC, abad wrote:
Try this:
extern(C++) void DoesNotLink(const(char)**);
That does work, though I have to explicitly cast it in my caller
as well.
Like this:
doesNotLink(cast(const(char)**)ba
import std.array : appender;
import std.stdio : writeln;
void main() {
auto app = appender!(char[]);
app.put('x');
auto foo = app.data;
app.clear; // done, start a new array
app.put('y');
writeln(foo);
}
This prints out 'y'. It's not surprising because what I suppose
app
On Thursday, 16 June 2016 at 07:59:50 UTC, cym13 wrote:
On Thursday, 16 June 2016 at 07:47:03 UTC, abad wrote:
import std.array : appender;
import std.stdio : writeln;
void main() {
auto app = appender!(char[]);
app.put('x');
auto foo = app.data;
app.clear; // done, start a new
On Wednesday, 28 December 2016 at 08:10:41 UTC, Nemanja Boric
wrote:
On Wednesday, 28 December 2016 at 05:09:34 UTC, LeqxLeqx wrote:
Perhaps this is a stupid question, and I apologize if it is,
but why doesn't this compile:
import std.algorithm;
import std.stdio;
void main()
{
This works:
class Foo {
protected void bar() {
writeln("hello from foo");
}
}
void main() {
auto foo = new Foo;
foo.bar();
}
Is this on purpose and what's the rationale?
Never mind, it's working OK if the class is defined in another
module.
Related question, it seems that final methods are allowed in
interfaces. Obviously you can't implement them anywhere, so is
this also on purpose and on what rationale? :)
On Wednesday, 29 March 2017 at 10:08:02 UTC, abad wrote:
Related question, it seems that final methods are allowed in
interfaces. Obviously you can't implement them anywhere, so is
this also on purpose and on what rationale? :)
So actually it's just a question of not catching this mistake
ear
On Wednesday, 29 March 2017 at 11:06:55 UTC, Petar Kirov
[ZombineDev] wrote:
On Wednesday, 29 March 2017 at 10:12:08 UTC, abad wrote:
On Wednesday, 29 March 2017 at 10:08:02 UTC, abad wrote:
Related question, it seems that final methods are allowed in
interfaces. Obviously you can't implement t
16 matches
Mail list logo