Why is my C++/CX ref class forbidden from having public methods that are templates or mention, say, std::vector?

· Raymond Chen · Nov. 19, 2021, 3 p.m.
Summary
A customer had a class implement in C++/CX¹ and they tried to add a public method: ref class MyClass { public: // 1 std::vector<int> GetValues(); // 2 void SetValues(std::vector<int> values); // 3 template<typename T> T GetValue(); }; But this generated errors: // 1 error C3986: 'SetValue': signature of public member contains native type 'std::vector<int,std::allocator<_Ty>>' // 2 error C3986: 'GetValues': signature of public member contains native type 'std::vector<int,std::allocato...
AUTHOR
Sponsored
Zulip logo Zulip
Organized team chat for people who take work seriously. Topic-based threading keeps conversations focused.
Try Zulip
Become a sponsor →