Fix typo in vk_raii_ProgrammingGuide.md (#1780)

This commit is contained in:
mirefly42 2024-02-05 11:21:49 +00:00 committed by GitHub
parent c5c1994f79
commit fdf975364b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,10 +30,10 @@ Alternatively, you can use a creation function to create a `vk::raii::Device`:
// create a vk::raii::Device, given a vk::raii::PhysicalDevice physicalDevice and a vk::DeviceCreateInfo deviceCreateInfo
vk::raii::Device device = physicalDevice.createDevice( deviceCreateInfo );
Finally, if you have defined `VULKAN_HPP_NO_EXCPETIONS` and compile for at least C++23, the constructors as described above are not available (they would potentially throw an exception which is not allowed then) but you have to use the construction functions. Those functions then do not return the created object, but a `std::expected<vk::raii::Object, vk::Result>`:
Finally, if you have defined `VULKAN_HPP_NO_EXCEPTIONS` and compile for at least C++23, the constructors as described above are not available (they would potentially throw an exception which is not allowed then) but you have to use the construction functions. Those functions then do not return the created object, but a `std::expected<vk::raii::Object, vk::Result>`:
// create a vk::raii::Device, given a vk::raii::PhysicalDevice physicalDevice and a vk::DeviceCreateInfo deviceCreateInfo
// when VULKAN_HPP_NO_EXCPETIONS is defined and your using at least C++23
// when VULKAN_HPP_NO_EXCEPTIONS is defined and your using at least C++23
auto deviceExpected = physicalDevice.createDevice( deviceCreateInfo );
if ( deviceExpected.has_value() )
{