4 ms·
Do you have any example of the kind of things that it would enable ? I must say i've never had the need for this feature, but maybe it's just because i've never
by bsaul 4y ago
Do you have any example of the kind of things that it would enable ? I must say i've never had the need for this feature, but maybe it's just because i've never used a language that had it..
- PoignardAzur 4y agoIt would allow you to write type constructors over lists of types. For instance, if you're writing an ECS manager, you could write something like: struct SystemManager<...Systems: System> { ... } // in user code let my_system: SystemManager<Collisions, 3dModels, PlayerInput, Networking, EnemyAi> = ... Also, it would make it a lot easier to write some macros; with variadic generics, derive macros could just generate a call to a variadic implementation (thus producing fewer tokens, thus better compile times), and have that implementation handle the bulk of the logic. Unlike a macro body, this macro would be type-checked at the writing site, leading to fewer post-monomorphization errors.