在c ++/cx中使用结构中的结构向量

Jip*_*ers 1 windows-runtime c++-cx

我有一个头文件定义了我想在我的代码中使用的一些结构.

public value struct HttpHeader
{
   Platform::String^ mName;
   Platform::String^ mValue;

};
typedef Platform::Collections::Vector<HttpHeader> HttpHeaders;

public value struct HttpRequestEvent
{
   Platform::String^ mUri;
   HttpHeaders^ mHeaders;
};
Run Code Online (Sandbox Code Playgroud)

当我构建这个时,我收到此错误:

error C3986: 'mHeaders': signature of public member contains native type 'std::equal_to<_Ty>'
      with
      [
          _Ty=cpcpb::HttpHeader
      ] (SettingsServiceImpl.cpp)
Run Code Online (Sandbox Code Playgroud)

我在这里错过了什么?不是我使用C++/Cx的一切吗?

Sup*_*man 6

Windows::Foundation::Collections::IVector而不是Platform::Collections::Vector.

要使用Platform::Collections::Vector你必须提供一个自定义比较器,它是equals运算符.

检查此链接 - http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/5ec2090f-b7e6-40e8-9cd7-75cf36d05ab3/