Add CheckedArray:__tostring() method

develop
lethosor 2016-08-22 23:18:30 -04:00
parent 1dab45ffed
commit 2dccd1d0ff
1 changed files with 3 additions and 0 deletions

@ -39,6 +39,9 @@ function CheckedArray:__newindex(idx, val)
end
self.data[idx] = val
end
function CheckedArray:__tostring()
return ('<CheckedArray: %s[%d]>'):format(self.type, self.count)
end
function CheckedArray:addr2idx(addr, round)
local off = addr - self.start
if off >= 0 and off < self.size and (round or (off % self.esize) == 0) then