대신 무엇을 써야합니까? ??????? 적절한 과부하를 선택 하시겠습니까?C#에서 적절한 제네릭 과부하를 참조하는 방법?
using System;
using System.Collections.Generic;
namespace ConsoleApplication2
{
class A {}
class B : A {}
class C : A {}
class Program
{
static void Main(string[] args)
{
var l1 = new List<C>();
var l2 = new List<C>();
Comparer<C>(l1, l2, ???????);
}
void Compare(C a, C b) { }
void Compare(B a, B b) {}
void Compare<T>(IList<T> a, IList<T> b, Action<T,T> comparator)
{
for (int i = 0; i < a.Count; i++)
comparator(a[i], b[i]);
}
}
}
감사합니다. – UserControl