Mark vk::ResultValue::asTuple() & as deprecated, introduce vk::ResultValue::asTuple() && (#1605)

This commit is contained in:
Andreas Süßenbach
2023-06-27 11:31:29 +02:00
committed by GitHub
parent 3d95b910da
commit 5d8c550b0d
3 changed files with 44 additions and 5 deletions

View File

@@ -40,12 +40,20 @@
, value(std::move(v))
{}
std::tuple<Result, UniqueHandle<Type, Dispatch>> asTuple()
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() &
{
return std::make_tuple( result, std::move( value ) );
}
Result result;
std::tuple<Result, UniqueHandle<Type, Dispatch>> asTuple() &&
{
return std::make_tuple( result, std::move( value ) );
}
Result result;
UniqueHandle<Type, Dispatch> value;
};
@@ -61,7 +69,15 @@
, value( std::move( v ) )
{}
std::tuple<Result, std::vector<UniqueHandle<Type, Dispatch>>> asTuple()
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() &&
{
return std::make_tuple( result, std::move( value ) );
}