3 public delegate V Mapper
<T
,V
> (T item
);
5 public interface ITree
<T
>
7 void Map
<V
> (Mapper
<T
,V
> mapper
);
10 public class Tree
<T
> : ITree
<T
>
19 public void Map
<V
> (Mapper
<T
,V
> mapper
)
21 V new_item
= mapper (item
);
27 private string themap (int i
)
29 return String
.Format ("AA {0,4} BB", i
);
34 Tree
<int> tree
= new Tree
<int> (3);
35 tree
.Map (new Mapper
<int,string> (themap
));