Hello!
I am wondering if there is an easy way to copy an element out of an Allocated section of memory back to the stack.
Example:
const count = try getPhysicalDeviceCount();
var devices = try allocator.alloc(c.VkPhysicalDevice, count);
defer allocator.free(devices)
// ignoring the result in this sample
c.vkEnumeratePhysicalDevices(instance, &count, devices.ptr);
var device: c.VkPhysicalDevice = undefined;
// @copy doesn't exist... but it is the magic I am missing
@copy(&device, &devices[0]);
return device;
Does @copy() exist but I have missed it? Can I create something similar?