It:
List<string> set = new List<string>() { "a","b" };
works fine, but:
Stack<string> set = new Stack<string>() { "a","b" }; Queue<string> set = new Queue<string>() { "a","b" };
failure:
...does not contain a definition for 'Add'
which makes me wonder why the compiler was stupid enough to ask Add.
So how to initialize in the Queue / Stack constructor?
Chrisjj
source share