Is possible to exclude specific types from the set of possible types, that can be used in a generic parameter? If so how.
For example
Foo()
Nope, you can't make one-off exclusions like that using type constraints. You can do it at runtime though:
public void Foo<T>() { if (typeof(T) == typeof(bool)) { //throw exception or handle appropriately. } }