This makes the Id (previously called Index) and Span types in our arena library parameterized on the type they refer to. So, for example, Id<Segment> is still "just" a u32, but it is a distinct type from Id<Path> (which is also just a u32 under the hood, of course). This makes the code a little more self-documenting and makes it impossible to confuse references to different types. It is, of course, still very much possible to confuse ids for different arenas of the same type!
Anyway, this was quite a bit less painful than I was expecting, so I think it's probably a good idea, despite the extra complexity.
This makes the
Id
(previously calledIndex
) andSpan
types in our arena library parameterized on the type they refer to. So, for example,Id<Segment>
is still "just" au32
, but it is a distinct type fromId<Path>
(which is also just au32
under the hood, of course). This makes the code a little more self-documenting and makes it impossible to confuse references to different types. It is, of course, still very much possible to confuse ids for different arenas of the same type!Anyway, this was quite a bit less painful than I was expecting, so I think it's probably a good idea, despite the extra complexity.