People, tell me how to use shared_ptr in C #?

There is a class in C ++ that has a method

 static std::shared_ptr<DeviceManager> getInstance(); 

I need to call this method, and use this object from a C # application.

I try to implement it through a C ++ / CLI wrapper. C ++, unfortunately, I don’t know :(

  • To do complex C ++ structures in C # is hard. Try to solve the problem in another way - ArchDemon
  • one
    Try to edit your question, explaining exactly what problem you are trying to solve this way. Perhaps there is a more appropriate solution that C ++ does not use at all. Meta.ru.stackoverflow.com/questions/709/… - Matty
  • The .NET environment allows complete garbage collection, so there is no need for a container. Maybe it's better to just store object references? - LokenGarvel '

0