Engineering & Technical Highlight: Let's Do Some Crimes. The wonders of abusing C# generics.
Talkat GCAP 2022: Ambition · on Tuesday, 2022-10-04· at 11:00· Room 109, 1 Convention Centre Place South Wharf, Victoria 3006·
summary
Generics are used to build zero-allocation utilities: a generic static class with a static constructor creates a precomputed enum info lookup table with safe To/From UInt64 casting, name lookup and HasName; extension methods and unsafe casts let enums convert without boxing. Iteration utilities take struct enumerators and use ref structs and a Begin helper to return a Zinc LINQ replacement that composes where/select without closures by passing invariants (value tuples) and avoids heap allocations. Code is road-tested in shipped games and published as Unity UPM packages.
AI-written summary · about
chapters (5)
- 0:00Introduction
- 7:48Enumerator boxing with generics
- 13:44Enum APIs with generics
- 27:03LINQ vs zero-allocation queries
- 44:31Q&A








