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:
Markus Tavenrath
2016-10-14 16:22:14 +02:00
committed by Andreas Süßenbach
parent d2423209f8
commit 1ba3ceaf3f
2 changed files with 6 additions and 0 deletions

View File

@@ -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>