mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-13 05:50:04 -04: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"
|
"\n"
|
||||||
" Result result;\n"
|
" Result result;\n"
|
||||||
" T value;\n"
|
" T value;\n"
|
||||||
|
"\n"
|
||||||
|
" operator std::tuple<Result&, T&>() { return std::tuple<Result&, T&>(result, value); }\n"
|
||||||
" };\n"
|
" };\n"
|
||||||
"\n"
|
"\n"
|
||||||
" template <typename T>\n"
|
" template <typename T>\n"
|
||||||
@ -3106,6 +3108,7 @@ int main( int argc, char **argv )
|
|||||||
<< "#include <initializer_list>" << std::endl
|
<< "#include <initializer_list>" << std::endl
|
||||||
<< "#include <string>" << std::endl
|
<< "#include <string>" << std::endl
|
||||||
<< "#include <system_error>" << std::endl
|
<< "#include <system_error>" << std::endl
|
||||||
|
<< "#include <tuple>" << std::endl
|
||||||
<< "#include <type_traits>" << std::endl
|
<< "#include <type_traits>" << std::endl
|
||||||
<< "#include <vulkan/vulkan.h>" << std::endl
|
<< "#include <vulkan/vulkan.h>" << std::endl
|
||||||
<< "#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE" << std::endl
|
<< "#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE" << std::endl
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <system_error>
|
#include <system_error>
|
||||||
|
#include <tuple>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <vulkan/vulkan.h>
|
#include <vulkan/vulkan.h>
|
||||||
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
|
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
|
||||||
@ -399,6 +400,8 @@ namespace vk
|
|||||||
|
|
||||||
Result result;
|
Result result;
|
||||||
T value;
|
T value;
|
||||||
|
|
||||||
|
operator std::tuple<Result&, T&>() { return std::tuple<Result&, T&>(result, value); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user