Reputation: 32525
[MyCustomClassAttribute]
public class Foo
{
}
public class Bar<T>
where T : ??
{
public T FooInstance;
}
I'm pretty sure this is impossible, but just thought I'd check. Any way to make it so that T has to have a [MyCustomClassAttribute]
on it?
Upvotes: 7
Views: 1260
Reputation: 1039438
I am afraid this is impossible. Here's a list of all the possible generic constraints you could use.
Upvotes: 5