#include "stdafx.h"
interfaceclass I
{
void f();
};
generic <typename T> where T : I
ref class MyGenericClass
{
T t;
public:
MyGenericClass(T t_in) : t(t_in)
{
t->f();
}
};
ref class C : I
{
public:
virtual void f()
{
}
};
int main()
{
MyGenericClass<C^>^ r = gcnew MyGenericClass<C^>(gcnew C());
}