日期:2014-05-18 浏览次数:20856 次
List<string> list = new List<string>() { "Ferrari", "McLaren", "Toyota", "BMW", "Renault", "Honda" }; HashSet<string> companyTeams = new HashSet<string>() { "Ferrari", "McLaren", "Toyota", "BMW", "Renault", "Honda" }; HashSet<string> companyTeams1 = new HashSet<string>(list);
------解决方案--------------------
既然是泛型,你凭什么任务人家应该是什么
因为 list 中是BoundaryCell,所以才有这么一句 HashSet<BoundaryCell>(list),转换list为HashSet<BoundaryCell>