Templates are awesome, and being able to have where clauses for traits on them make them really useful. However, I have come across the desire to be able to be able to template over a type that is an enum for writing a library.
Basically the idea is to add the ability to do the following:
fn foobar<T: enum> (x: T)
or
fn foobar<T: enum()> (x: T)
This would mean (in the first case) that it accepts any enum that is unit-like and (in the second case) that may not be unit-like.
Usage:
This would allow the user of the functions or structs to specify his own enum type and the library writer can write assuming certain conditions. These could be used for ordering or labeling purposes without knowing how many values within the enum are specified.