Managed objects in C++