I want to port the following code from c# to c++/cli:
class MyClass : IEnumerable<int> { ... }
I’ve tried
class ref class MyClass : IEnumerable<int>
but it doesn’t seem to be working.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C++ has multiple types of inheritance. Don’t forget to specify it, e.g.:
In C++/CLI, I frequently find myself spelling out the full namespace in interface implementations. E.g.:
If your class doesn’t actually implement the provided interface, you’ll also (of course) get an error. And you’ll want to remove the
^from the class declaration. You’re inheriting from an interface, not from a GC Handle to an instance of that interface.