5 ms·
Yes, good point. But if you did have a type constraint, like C#, you would still need the runtime type info to know what to create. This is legal in C#: public
by adevine 10y ago
Yes, good point. But if you did have a type constraint, like C#, you would still need the runtime type info to know what to create. This is legal in C#:
public static T Factory<T>() where T:new()
{
return new T();
}