File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Params:
1515 size = size in bits
1616+/
1717struct UInt (size_t size)
18- if (size % (size_t .sizeof * 8 ) == 0 && size >= ( size_t.sizeof * 8) )
18+ if (size % (size_t .sizeof * 8 ) == 0 && size >= size_t.sizeof * 8)
1919{
2020 import mir.bignum.fixed: UInt;
2121 /+ +
@@ -25,7 +25,7 @@ struct UInt(size_t size)
2525
2626 // /
2727 this (size_t N)(auto ref const size_t [N] data)
28- if (N <= this .data.length)
28+ if (N && N <= this .data.length)
2929 {
3030 version (LittleEndian )
3131 this .data[0 .. N] = data;
@@ -306,6 +306,15 @@ struct UInt(size_t size)
306306 return this ;
307307 }
308308
309+ /+ +
310+ +/
311+ ref UInt! size opAssign (uint rhsSize)(UInt! rhsSize rhs) scope return
312+ @safe pure nothrow @nogc
313+ {
314+ this .data = UInt! size(rhs).data;
315+ return this ;
316+ }
317+
309318 /+ +
310319 `bool overflow = a += b ` and `bool overflow = a -= b` operations.
311320 +/
You can’t perform that action at this time.
0 commit comments