Suppose I have a type
A<T> that depends on type T and want to use cargo features to decide T at compile time.
I could do something like
#[cfg(feature = "a")] let s = A<i64> #[cfg(feature = "b")] let s = A<bool>
and so on. However this is not very efficient once I have many types that all depend on T, like
A1, ... A100
Is there a cleaner way to do this for many types? Maybe a macro, or better some type definition. Something like
#[cfg(feature = "a")] type T = i64 #[cfg(feature = "b")] type T = bool
and then I can just use T everywhere...