On 10/10/13 20:28, Sean Kelly wrote:
Isn't BigInt a struct?  I'd expect it to work via copying just like concrete 
types.

Yes, it's a struct, but somewhere inside its internals I think it contains arrays. I'm not sure how that affects copying etc., but suffice to say that if you try the following:

    BigInt a = 2;
    BigInt b = a;
    b = 3;
    assert(a != b);
    assert(a !is b);

... then it passes.  So it behaves at least in this extent like a value type.

But suffice to say that it was an unpleasant surprise that I couldn't just take it and pass to a function accepting an unqualified BigInt argument.

Reply via email to