J
julio
What's wrong with this?
var d = new Dictionary<int, Pair>();
d[100] = new Pair(10, 20);
d[100].first = 11;
I get (abbreviated) "cannot modify return value of ...Dictionary<int,
Pair>.this[int] b/c not a variable".
Here I have
public struct Pair {
public int first;
public int second;
public Pair(int f, int s) { first = f ; second = s;}
}
var d = new Dictionary<int, Pair>();
d[100] = new Pair(10, 20);
d[100].first = 11;
I get (abbreviated) "cannot modify return value of ...Dictionary<int,
Pair>.this[int] b/c not a variable".
Here I have
public struct Pair {
public int first;
public int second;
public Pair(int f, int s) { first = f ; second = s;}
}