mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Add support for std::tie on ResultValues. This allows developers to write (#39)
vk::Result result; vk::Image image; std::tie(result, image) = device.createImage(...); when using the non-exception mode.
This commit is contained in:
parent
d2423209f8
commit
1ba3ceaf3f
@ -319,6 +319,8 @@ std::string const resultValueHeader = (
|
||||
"\n"
|
||||
" Result result;\n"
|
||||
" T value;\n"
|
||||
"\n"
|
||||
" operator std::tuple<Result&, T&>() { return std::tuple<Result&, T&>(result, value); }\n"
|
||||
" };\n"
|
||||
"\n"
|
||||
" template <typename T>\n"
|
||||
@ -3106,6 +3108,7 @@ int main( int argc, char **argv )
|
||||
<< "#include <initializer_list>" << std::endl
|
||||
<< "#include <string>" << std::endl
|
||||
<< "#include <system_error>" << std::endl
|
||||
<< "#include <tuple>" << std::endl
|
||||
<< "#include <type_traits>" << std::endl
|
||||
<< "#include <vulkan/vulkan.h>" << std::endl
|
||||
<< "#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE" << std::endl
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <initializer_list>
|
||||
#include <string>
|
||||
#include <system_error>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <vulkan/vulkan.h>
|
||||
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
|
||||
@ -399,6 +400,8 @@ namespace vk
|
||||
|
||||
Result result;
|
||||
T value;
|
||||
|
||||
operator std::tuple<Result&, T&>() { return std::tuple<Result&, T&>(result, value); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
Loading…
Reference in New Issue
Block a user