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] _
On Saturday, 11 July 2015 at 13:31:12 UTC, Peter wrote:
The postblit can only not take @nogc due to the array
duplication which is understandable.
I think the postblit might be redundant anyway since the struct
is built on a static array so there is no possibility of two
different Vect3s "point
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
On Tue, 07 Jul 2015 11:09:52 +, Peter wrote:
Any ideas about what's happening?
yes. there is code in "arrayop.c" that tells:
// Built-in array ops should be @trusted, pure, nothrow and
nogc
StorageClass stc = STCtrusted | STCpure | STCnothrow |
STCnogc;
under the hoods compile
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 {
On Monday, 6 July 2015 at 12:15:22 UTC, Peter wrote:
dmd 2.066.1, windows 7 64bit
Tested it on Windows 7, using dmd 2.066.1: works for me.
The exact code I tested (just commented those "..." out):
struct Vector3 {
public double[3] _p;
//...
Vector3 opBinary(string op)(in Vecto
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
On Monday, 6 July 2015 at 03:02:59 UTC, Nicholas Wilson wrote:
On Monday, 6 July 2015 at 01:16:54 UTC, Peter wrote:
[...]
unittest{
auto a = Vector3([2.0, 2.0, 0.0]);
auto b = Vector3([1.0, 2.0, 1.0]);
Vector3[] c = [a];
Vector3[] d = [b];
Vector3 e = a + b; // works
Vec
On Monday, 6 July 2015 at 01:16:54 UTC, Peter wrote:
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 == "+
On Monday, 6 July 2015 at 03:02:59 UTC, Nicholas Wilson wrote:
On Monday, 6 July 2015 at 01:16:54 UTC, Peter wrote:
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;
...
Ve
On Monday, 6 July 2015 at 01:16:54 UTC, Peter wrote:
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 == "+
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
12 matches
Mail list logo