Fixed Device::createResultValue to return ResultValueType<T>::type

Modified to return T & data when exceptions are enabled otherwise return ReturnValue<T>( result, data )
This commit is contained in:
Julian van Doorn 2017-11-17 21:53:57 +01:00
parent e464d695dd
commit 9a2d54f066

View File

@ -945,17 +945,18 @@ namespace VULKAN_HPP_NAMESPACE
} }
template <typename T> template <typename T>
VULKAN_HPP_INLINE ResultValue<T> createResultValue( Result result, T & data, char const * message, std::initializer_list<Result> successCodes ) VULKAN_HPP_INLINE typename ResultValueType<T>::type createResultValue( Result result, T & data, char const * message, std::initializer_list<Result> successCodes )
{ {
#ifdef VULKAN_HPP_NO_EXCEPTIONS #ifdef VULKAN_HPP_NO_EXCEPTIONS
assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() ); assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
return ResultValue<T>( result, data );
#else #else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() ) if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
{ {
throwResultException( result, message ); throwResultException( result, message );
} }
#endif #endif
return ResultValue<T>( result, data ); return data;
} }
using SampleMask = uint32_t; using SampleMask = uint32_t;