You are confused about absolutely nothing. `create` does exactly what you think it does, namely `cast[ptr T](alloc0(sizeof(T) * size))` and it's just that you passed the wrong `T`. You can conclude from that that `ptr object` is to be avoided but in reality it's just that `create` is not very useful -- when you use `ptr` it's usually for C interop or custom allocation needs. In these cases the `alloc0` (Nim's allocator) is rarely what you want.
- Struggling to understand use of ptr object Types jhwbarlow
- Struggling to understand use of ptr object Types mratsim
- Struggling to understand use of ptr object Types Araq
- Struggling to understand use of ptr object Types jhwbarlow
- Struggling to understand use of ptr object Type... Araq
