سؤال

I have a header file defining some structs I want to use in my code.

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;
};

When I build this I get this error:

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

What am I missing here? Isn't everything I'm using C++/Cx?

هل كانت مفيدة؟

المحلول

Use Windows::Foundation::Collections::IVector instead of Platform::Collections::Vector.

To use Platform::Collections::Vector you have to provide a custom comparator which is the equals operator.

Check this link - http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/5ec2090f-b7e6-40e8-9cd7-75cf36d05ab3/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top