It's called the same way, `N` is taken from the object itself.
type
Object[size: static[int]] = object
list0 : array[size, int]
list1 : array[size, string]
list2 : array[size, float]
var o: Object[2]
echo o.size
proc size1[N](x: Object[N]): int = N
echo o.size1
template size2[N](x: Object[N]): int = N
echo o.size2
Run
- Re: Using fields to define other fields Allosteric
- Re: Using fields to define other fields Stefan_Salewski
- Re: Using fields to define other fields Allosteric
- Re: Using fields to define other fields Stefan_Salewski
- Re: Using fields to define other fields Allosteric
- Re: Using fields to define other fields Allosteric
- Re: Using fields to define other fields LeuGim
- Re: Using fields to define other fields Allosteric
- Re: Using fields to define other fields lemonboy
- Re: Using fields to define other fields Allosteric
- Re: Using fields to define other fields LeuGim
- Re: Using fields to define other fields Allosteric
