2022-07-28 15:09:08 +00:00
template < typename T >
struct ResultValue
{
# ifdef VULKAN_HPP_HAS_NOEXCEPT
ResultValue ( Result r , T & v ) VULKAN_HPP_NOEXCEPT ( VULKAN_HPP_NOEXCEPT ( T ( v ) ) )
# else
ResultValue ( Result r , T & v )
# endif
: result ( r )
, value ( v )
{ }
# ifdef VULKAN_HPP_HAS_NOEXCEPT
ResultValue ( Result r , T & & v ) VULKAN_HPP_NOEXCEPT ( VULKAN_HPP_NOEXCEPT ( T ( std : : move ( v ) ) ) )
# else
ResultValue ( Result r , T & & v )
# endif
: result ( r )
, value ( std : : move ( v ) )
{ }
Result result ;
T value ;
operator std : : tuple < Result & , T & > ( ) VULKAN_HPP_NOEXCEPT { return std : : tuple < Result & , T & > ( result , value ) ; }
} ;
# if !defined( VULKAN_HPP_NO_SMART_HANDLE )
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 ( std : : move ( v ) )
{ }
2023-06-27 09:31:29 +00:00
VULKAN_HPP_DEPRECATED (
" asTuple() on an l-value is deprecated, as it implicitly moves the UniqueHandle out of the ResultValue. Use asTuple() on an r-value instead, requiring to explicitly move the UniqueHandle. " )
std : : tuple < Result , UniqueHandle < Type , Dispatch > >
asTuple ( ) &
2022-07-28 15:09:08 +00:00
{
return std : : make_tuple ( result , std : : move ( value ) ) ;
}
2023-06-27 09:31:29 +00:00
std : : tuple < Result , UniqueHandle < Type , Dispatch > > asTuple ( ) & &
{
return std : : make_tuple ( result , std : : move ( value ) ) ;
}
Result result ;
2022-07-28 15:09:08 +00:00
UniqueHandle < Type , Dispatch > value ;
} ;
template < typename Type , typename Dispatch >
struct ResultValue < std : : vector < UniqueHandle < Type , Dispatch > > >
{
# ifdef VULKAN_HPP_HAS_NOEXCEPT
ResultValue ( Result r , std : : vector < UniqueHandle < Type , Dispatch > > & & v ) VULKAN_HPP_NOEXCEPT
# else
ResultValue ( Result r , std : : vector < UniqueHandle < Type , Dispatch > > & & v )
# endif
: result ( r )
, value ( std : : move ( v ) )
{ }
2023-06-27 09:31:29 +00:00
VULKAN_HPP_DEPRECATED (
" asTuple() on an l-value is deprecated, as it implicitly moves the UniqueHandle out of the ResultValue. Use asTuple() on an r-value instead, requiring to explicitly move the UniqueHandle. " )
std : : tuple < Result , std : : vector < UniqueHandle < Type , Dispatch > > >
asTuple ( ) &
{
return std : : make_tuple ( result , std : : move ( value ) ) ;
}
std : : tuple < Result , std : : vector < UniqueHandle < Type , Dispatch > > > asTuple ( ) & &
2022-07-28 15:09:08 +00:00
{
return std : : make_tuple ( result , std : : move ( value ) ) ;
}
Result result ;
std : : vector < UniqueHandle < Type , Dispatch > > value ;
} ;
# endif
template < typename T >
struct ResultValueType
{
# ifdef VULKAN_HPP_NO_EXCEPTIONS
2024-03-11 08:37:43 +00:00
using type = ResultValue < T > ;
2022-07-28 15:09:08 +00:00
# else
2024-03-11 08:37:43 +00:00
using type = T ;
2022-07-28 15:09:08 +00:00
# endif
} ;
template < >
struct ResultValueType < void >
{
# ifdef VULKAN_HPP_NO_EXCEPTIONS
2024-03-11 08:37:43 +00:00
using type = Result ;
2022-07-28 15:09:08 +00:00
# else
2024-03-11 08:37:43 +00:00
using type = void ;
2022-07-28 15:09:08 +00:00
# endif
} ;
2024-04-08 09:40:53 +00:00
namespace detail
2022-07-28 15:09:08 +00:00
{
2024-04-08 09:40:53 +00:00
template < typename T >
void ignore ( T const & ) VULKAN_HPP_NOEXCEPT
{
}
VULKAN_HPP_INLINE typename VULKAN_HPP_NAMESPACE : : ResultValueType < void > : : type createResultValueType ( VULKAN_HPP_NAMESPACE : : Result result )
{
2022-07-28 15:09:08 +00:00
# ifdef VULKAN_HPP_NO_EXCEPTIONS
2024-04-08 09:40:53 +00:00
return result ;
2022-07-28 15:09:08 +00:00
# else
2024-04-08 09:40:53 +00:00
VULKAN_HPP_NAMESPACE : : detail : : ignore ( result ) ;
2022-07-28 15:09:08 +00:00
# endif
2024-04-08 09:40:53 +00:00
}
2022-07-28 15:09:08 +00:00
2024-04-08 09:40:53 +00:00
template < typename T >
VULKAN_HPP_INLINE typename VULKAN_HPP_NAMESPACE : : ResultValueType < T > : : type createResultValueType ( VULKAN_HPP_NAMESPACE : : Result result , T & data )
{
2022-07-28 15:09:08 +00:00
# ifdef VULKAN_HPP_NO_EXCEPTIONS
2024-04-08 09:40:53 +00:00
return ResultValue < T > ( result , data ) ;
2022-07-28 15:09:08 +00:00
# else
2024-04-08 09:40:53 +00:00
VULKAN_HPP_NAMESPACE : : detail : : ignore ( result ) ;
return data ;
2022-07-28 15:09:08 +00:00
# endif
2024-04-08 09:40:53 +00:00
}
2022-07-28 15:09:08 +00:00
2024-04-08 09:40:53 +00:00
template < typename T >
VULKAN_HPP_INLINE typename VULKAN_HPP_NAMESPACE : : ResultValueType < T > : : type createResultValueType ( VULKAN_HPP_NAMESPACE : : Result result , T & & data )
{
2022-07-28 15:09:08 +00:00
# ifdef VULKAN_HPP_NO_EXCEPTIONS
2024-04-08 09:40:53 +00:00
return ResultValue < T > ( result , std : : move ( data ) ) ;
2022-07-28 15:09:08 +00:00
# else
2024-04-08 09:40:53 +00:00
VULKAN_HPP_NAMESPACE : : detail : : ignore ( result ) ;
return std : : move ( data ) ;
2022-07-28 15:09:08 +00:00
# endif
2024-04-08 09:40:53 +00:00
}
} // namespace detail