Unused template arguments; what type to use?

drathier forum.dlang.org at fi.fo
Fri Jun 26 13:21:25 UTC 2020


How can I tell the compiler that I will never create a value of 
type X, while still being able to write code that uses it? Using 
void as a template parameter is where I started, but I still need 
to be able to declare variables inside this unreachable function, 
like `T foo;` even when `T == void`. Can I get any closer to what 
I want than an empty struct?


More information about the Digitalmars-d-learn mailing list