using System.Collections.Generic;
public sealed class LoLQueue<T> where T: class
{
private SingleLinkNode<T> mHe;
private SingleLinkNode<T> mTa;
public LoLQueue()
{
this.mHe = new SingleLinkNode<T>();
this.mTa = this.mHe;
}
}
Error:
The non-generic type 'LoLQueue<T>.SingleLinkNode' cannot be used with type arguments
Why do i get this?
If you want to use IEnumerable<T>
, as your post's title suggests, you need to include using System.Collections.Generic;
.
As for the SingleLinkNode class, I don't know where you got it, it's not part of the .NET framework that I can see. I'd guess that it isn't implemented using generics, and you'll need to add a bunch of casts from object
to T
everywhere.