我有两个类Device
和DeviceMemory
,Device
的字段memory
的类型为DeviceMemory
,因此当Device
被销毁时, DeviceMemory
被释放。
class DeviceMemory {
void func();
}
class Device {
VkPhysicalDevice phys_dev;
VkDevice logi_dev;
DeviceMemory memory;
}
如何使func
能够从拥有的设备访问phys_dev
和logi_dev
?