Re: ubyte array changing values between calls? Possible bug?

2013-12-15 Thread Gary Willoughby
On Sunday, 15 December 2013 at 00:21:37 UTC, Ali Çehreli wrote: On 12/14/2013 10:48 AM, Gary Willoughby wrote: > On Friday, 13 December 2013 at 17:35:27 UTC, John Colvin wrote: >>> public void opAssign(uint value) >>> { >>> this._octets = value.nativeToBigEndian(); >>> a

Re: ubyte array changing values between calls? Possible bug?

2013-12-14 Thread Ali Çehreli
On 12/14/2013 10:48 AM, Gary Willoughby wrote: > On Friday, 13 December 2013 at 17:35:27 UTC, John Colvin wrote: >>> public void opAssign(uint value) >>> { >>> this._octets = value.nativeToBigEndian(); >>> assert(this._octets == [1, 2, 3, 4]); >>> } >>> } >> opAssign

Re: ubyte array changing values between calls? Possible bug?

2013-12-14 Thread Gary Willoughby
On Friday, 13 December 2013 at 17:35:27 UTC, John Colvin wrote: On Friday, 13 December 2013 at 16:37:51 UTC, Gary Willoughby wrote: I have the following code which is massively simplified from a larger type. The problem occurs between assigning the value to the type and retrieving it. The val

Re: ubyte array changing values between calls? Possible bug?

2013-12-14 Thread John Colvin
On Friday, 13 December 2013 at 18:01:53 UTC, Rémy Mouëza wrote: It works fine when using dup to the value returned by nativeToBigEndian: public void opAssign(uint value) { this._octets = value.nativeToBigEndian().dup; assert(this._octets == cast (ubyte[]) [1, 2, 3, 4]);

Re: ubyte array changing values between calls? Possible bug?

2013-12-13 Thread Rémy Mouëza
It works fine when using dup to the value returned by nativeToBigEndian: public void opAssign(uint value) { this._octets = value.nativeToBigEndian().dup; assert(this._octets == cast (ubyte[]) [1, 2, 3, 4]); } On 12/13/2013 06:35 PM, John Colvin wrote: On Friday, 13

Re: ubyte array changing values between calls? Possible bug?

2013-12-13 Thread John Colvin
On Friday, 13 December 2013 at 16:37:51 UTC, Gary Willoughby wrote: I have the following code which is massively simplified from a larger type. The problem occurs between assigning the value to the type and retrieving it. The value is assigned through opAssign and the assert passes. When usin

ubyte array changing values between calls? Possible bug?

2013-12-13 Thread Gary Willoughby
I have the following code which is massively simplified from a larger type. The problem occurs between assigning the value to the type and retrieving it. The value is assigned through opAssign and the assert passes. When using a property to retrieve the same data the assert fails! import std