Jump to content

Parametric polymorphism: Difference between revisions

→‎{{header|C sharp|C#}}: Fix compilation error in main program, cannot implicitly convert type BinaryTree<int> to type BinaryTree<U>
No edit summary
(→‎{{header|C sharp|C#}}: Fix compilation error in main program, cannot implicitly convert type BinaryTree<int> to type BinaryTree<U>)
Line 140:
class Program {
static void Main(string[] args) {
BinaryTree<Uint> b = new BinaryTree<int>(6);
b.left = new BinaryTree<int>(5);
b.right = new BinaryTree<int>(7);
BinaryTree<Udouble> b2 = b.Map(x => x * 10.0);
}
}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.