[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef object
From: |
Andrew Janke |
Subject: |
[Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects |
Date: |
Sat, 2 Mar 2019 08:30:38 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36 |
Follow-up Comment #1, bug #55810 (project octave):
Oh, whoops: looks like `whos` does not respect `sizeof` overrides. If I add a
custom sizeof to MyDumbClass:
classdef MyDumbClass
properties
data
endproperties
methods
function this = MyDumbClass (data)
this.data = data;
endfunction
function out = sizeof (this)
out = sizeof (this.data);
endfunction
endmethods
endclassdef
Then sizeof() reports a big number, but whos() still shows 0 bytes.
>> sizeof(x)
ans = 8000000
>> whos
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 1x1 8 double
x 1x1 0 MyDumbClass
Total is 2 elements using 8 bytes
Maybe whos() should delegate to sizeof(), respecting overrides?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55810>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects, Andrew Janke, 2019/03/02
- [Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects,
Andrew Janke <=
- [Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects, Andrew Janke, 2019/03/02
- [Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects, Rik, 2019/03/02
- [Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects, Andrew Janke, 2019/03/02
- [Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects, Rik, 2019/03/03
- [Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects, Mike Miller, 2019/03/03
- [Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects, Andrew Janke, 2019/03/04
- [Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects, Mike Miller, 2019/03/05
- [Octave-bug-tracker] [bug #55810] sizeof() and whos() returns 0 bytes for classdef objects, Mike Miller, 2019/03/11