Re: Missing Symbol Accessing Templated Function Through Interface

2016-03-08 Thread Peter via Digitalmars-d-learn
On Tuesday, 8 March 2016 at 12:24:06 UTC, crimaniak wrote: On Tuesday, 8 March 2016 at 11:50:32 UTC, Peter wrote: Hi, Can anyone explain to me what's causing the following code to generate a missing symbol error... Relevant comment: https://issues.dlang.org/show_bug.cgi?id=8553#c1 Thanks

Missing Symbol Accessing Templated Function Through Interface

2016-03-08 Thread Peter via Digitalmars-d-learn
Hi, Can anyone explain to me what's causing the following code to generate a missing symbol error... import std.stdio; interface IProblem { void writeln(T...)(T arguments); } class Problem : IProblem { void writeln(T...)(T arguments) { // This is just here to have code in an impl

Re: Array operations with array of structs

2015-07-11 Thread Peter via Digitalmars-d-learn
On Saturday, 11 July 2015 at 13:31:12 UTC, Peter wrote: So after looking into it a little bit... So now I'm trying to multiply the array by a double but it's giving incompatible type errors. opBinary, opBinaryRight, and opOpAssign are defined. I have: struct Vector3 { public double[3] _

Re: Array operations with array of structs

2015-07-11 Thread Peter via Digitalmars-d-learn
On Wednesday, 8 July 2015 at 06:05:54 UTC, ketmar wrote: do you see the gotcha? if you uncomment postblit or assigns, this build function fails to compile, as that operations aren't "pure nothrow @nogc @trusted", and they will be used for either assign or postblitting. So after looking into i

Re: Array operations with array of structs

2015-07-07 Thread Peter via Digitalmars-d-learn
On Monday, 6 July 2015 at 15:48:28 UTC, anonymous wrote: Ok, I disabled everything in the struct except what I posted and it ran. I then uncommented stuff to isolate the cause. I've added in the bits that cause the error below (plus some constructors just for reference). struct Vector3 {

Re: Array operations with array of structs

2015-07-06 Thread Peter via Digitalmars-d-learn
On Monday, 6 July 2015 at 10:29:35 UTC, anonymous wrote: Works for me with various versions of dmd on linux. What compiler are you using, what version of it, what operating system, etc? dmd 2.066.1, windows 7 64bit

Array operations with array of structs

2015-07-05 Thread Peter via Digitalmars-d-learn
Hi, I have a struct with arithmetic operations defined using opBinary but array operations with arrays of it don't work. struct Vector3 { public double[3] _p; ... Vector3 opBinary(string op)(in Vector3 rhs) const if (op == "+"){ Vector3 result; result._p[] = this