Add cast operator to reference of UniqueHandle of ResultValue<UniqueHandle>.

This commit is contained in:
asuessenbach
2020-06-17 10:10:57 +02:00
parent e83bd40ab5
commit 3724bfd0f5
5 changed files with 49 additions and 48 deletions

View File

@@ -52,7 +52,7 @@
# include <compare>
#endif
static_assert( VK_HEADER_VERSION == 143, "Wrong VK_HEADER_VERSION!" );
static_assert( VK_HEADER_VERSION == 144, "Wrong VK_HEADER_VERSION!" );
// 32-bit vulkan is not typesafe for handles, so don't allow copy constructors on this platform by default.
// To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION
@@ -15887,15 +15887,6 @@ namespace VULKAN_HPP_NAMESPACE
template <typename Type, typename Dispatch>
struct ResultValue<UniqueHandle<Type, Dispatch>>
{
# ifdef VULKAN_HPP_HAS_NOEXCEPT
ResultValue( Result r, UniqueHandle<Type, Dispatch> & v ) VULKAN_HPP_NOEXCEPT
# else
ResultValue( Result r, UniqueHandle<Type, Dispatch> & v )
# endif
: result( r )
, value( v )
{}
# ifdef VULKAN_HPP_HAS_NOEXCEPT
ResultValue( Result r, UniqueHandle<Type, Dispatch> && v ) VULKAN_HPP_NOEXCEPT
# else
@@ -15913,6 +15904,11 @@ namespace VULKAN_HPP_NAMESPACE
return std::tuple<Result &, UniqueHandle<Type, Dispatch> &>( result, value );
}
operator UniqueHandle<Type, Dispatch> &() & VULKAN_HPP_NOEXCEPT
{
return value;
}
operator UniqueHandle<Type, Dispatch>() VULKAN_HPP_NOEXCEPT
{
return std::move( value );