Consider this ad using generics:
public class BaseNode<TNode> where TNode : BaseNode<TNode> { public class Node : BaseNode<Node> { public Node() { } } }
Is there a way to create an instance of a Node class from outside the base class? I have used this template before, but always leave the derived classes outside the base class.
How do you write the following without a compiler error?
var obj = new BaseNode<Node>.Node(); // error CS0246: The type or namespace name 'Node' could not be found
Did I create a non replicable class? Can it be initialized with reflection?
source share