我最近安装了VS2012。一个在VS2010下编译成功的C++项目(使用.Net 4.0),在VS2012下无法识别
但是这只会导致错误:
文档显示该功能在System.Collections.Generic中。然而C++编译器并不认为如此。你有任何想法它去了哪里吗?
HashSet<T>
。我甚至尝试了以下声明:System::Collections::Generic::HashSet< String^ >^ _reasons;
但是这只会导致错误:
error C2039: 'HashSet' : is not a member of 'System::Collections::Generic
文档显示该功能在System.Collections.Generic中。然而C++编译器并不认为如此。你有任何想法它去了哪里吗?
unordered_set
。 - Bartek BanachewiczSystem.Core
程序集?System::Collections::Generic
命名空间存在于多个程序集中,如果你引用其中一个程序集但不是包含HashSet的程序集,则会得到该错误消息。 - David Yaw