From 9a2d54f066523e6367cef36177446ebce699d80e Mon Sep 17 00:00:00 2001 From: Julian van Doorn Date: Fri, 17 Nov 2017 21:53:57 +0100 Subject: [PATCH] Fixed Device::createResultValue to return ResultValueType::type Modified to return T & data when exceptions are enabled otherwise return ReturnValue( result, data ) --- vulkan/vulkan.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 9086b94..c1ba37d 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -945,17 +945,18 @@ namespace VULKAN_HPP_NAMESPACE } template - VULKAN_HPP_INLINE ResultValue createResultValue( Result result, T & data, char const * message, std::initializer_list successCodes ) + VULKAN_HPP_INLINE typename ResultValueType::type createResultValue( Result result, T & data, char const * message, std::initializer_list successCodes ) { #ifdef VULKAN_HPP_NO_EXCEPTIONS assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() ); + return ResultValue( result, data ); #else if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() ) { throwResultException( result, message ); } #endif - return ResultValue( result, data ); + return data; } using SampleMask = uint32_t;