The non-generic type 'System.Collections.IEnumerable' cannot be used with type arguments?

I'm pretty sure you haven't defined your SingleLinkNode class as having a generic type parameter. As such, an attempt to declare it with one is failing The error message suggests that SingleLinkNode is a nested class, so I suspect what may be happening is that you are declaring members of SingleLinkNode of type T without actually declaring T as a generic parameter for SingleLinkNode You still need to do this if you want SingleLinkNode to be generic, but if not, then you can simply use the class as SingleLinkNode rather than SingleLinkNode where T : class { private class Node { public T data; // T will be of the type use to construct Generic } private Node myNode; // No need for Node } If you do want your nested class to be generic, then this will work: public class Generic where T : class { private class Node { public U data; // U can be anything } private Node myNode; // U will be of type T }.

I'm pretty sure you haven't defined your SingleLinkNode class as having a generic type parameter. As such, an attempt to declare it with one is failing. The error message suggests that SingleLinkNode is a nested class, so I suspect what may be happening is that you are declaring members of SingleLinkNode of type T, without actually declaring T as a generic parameter for SingleLinkNode.

You still need to do this if you want SingleLinkNode to be generic, but if not, then you can simply use the class as SingleLinkNode rather than SingleLinkNode. Example of what I mean: public class Generic where T : class { private class Node { public T data; // T will be of the type use to construct Generic } private Node myNode; // No need for Node } If you do want your nested class to be generic, then this will work: public class Generic where T : class { private class Node { public U data; // U can be anything } private Node myNode; // U will be of type T }.

This compiles for me: public sealed class SingleLinkNode { } public sealed class LoLQueue where T : class { private SingleLinkNode mHe; private SingleLinkNode mTa; public LoLQueue() { this. MHe = new SingleLinkNode(); this. MTa = this.

MHe; } } You'll need to post your SingleLinkNode class for further answers... John.

If you want to use IEnumerable, 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.

Still nothing =\ – Danpe Aug 3 at 18:41 He already has that listed on the first line of his code. – WEFX Aug 3 at 18:43 True, but considering the title of this question is "The non-generic type System.Collections. IEnumerable", I assumed that something changed in the copy-paste of code.

– David Yaw Aug 3 at 18:46.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions