The original solution should work without allocation. I use a `noRef` helper
for `sizeof` and `=destroy`
echo sizeof(block:
echo "no side effect"
MyRefObject()[])
template noRef*(T: typedesc): typedesc =
typeof(default(T)[])
echo sizeof(noRef(MyRefObject))
Run
- sizeof a ref object type vitreo12
- Re: sizeof a ref object type roel
- Re: sizeof a ref object type vitreo12
- Re: sizeof a ref object type mratsim
- Re: sizeof a ref object type roel
- Re: sizeof a ref object type jyapayne
- Re: sizeof a ref object type jasper
