|
|
|
|
|
by mratzloff
4711 days ago
|
|
Yes, but the `container/list` standard library uses the same approach. I wrote a Cartesian product library that took a different tack--it splits the index and iterator cursor logic (integer fiddling) into one struct and the actual type into another, so it's easy to build type-checked objects. In full disclosure, though, that was mainly because the alternative (using `interface{}`) was so utterly painful. |
|