mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Mark vk::ResultValue::asTuple() & as deprecated, introduce vk::ResultValue::asTuple() && (#1605)
This commit is contained in:
parent
3d95b910da
commit
5d8c550b0d
@ -40,12 +40,20 @@
|
|||||||
, value(std::move(v))
|
, 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 ) );
|
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;
|
UniqueHandle<Type, Dispatch> value;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -61,7 +69,15 @@
|
|||||||
, value( std::move( v ) )
|
, 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 ) );
|
return std::make_tuple( result, std::move( value ) );
|
||||||
}
|
}
|
||||||
|
@ -262,6 +262,13 @@ int main( int /*argc*/, char ** /*argv*/ )
|
|||||||
);
|
);
|
||||||
|
|
||||||
// create a GraphicsPipeline
|
// create a GraphicsPipeline
|
||||||
|
vk::ResultValue<vk::UniquePipeline> rv = device->createGraphicsPipelineUnique( *pipelineCache, graphicsPipelineCreateInfo );
|
||||||
|
#if 17 <= VULKAN_HPP_CPP_VERSION
|
||||||
|
auto [r, v] = std::move( rv );
|
||||||
|
#endif
|
||||||
|
// auto trv = rv.asTuple(); // asTuple() on an l-value is deprecated !!
|
||||||
|
auto trv1 = std::move( rv ).asTuple();
|
||||||
|
|
||||||
vk::UniquePipeline graphicsPipeline = device->createGraphicsPipelineUnique( *pipelineCache, graphicsPipelineCreateInfo ).value;
|
vk::UniquePipeline graphicsPipeline = device->createGraphicsPipelineUnique( *pipelineCache, graphicsPipelineCreateInfo ).value;
|
||||||
|
|
||||||
vk::UniquePipeline graphicsPipeline2 =
|
vk::UniquePipeline graphicsPipeline2 =
|
||||||
|
@ -6788,7 +6788,15 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
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 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
std::tuple<Result, UniqueHandle<Type, Dispatch>> asTuple() &&
|
||||||
{
|
{
|
||||||
return std::make_tuple( result, std::move( value ) );
|
return std::make_tuple( result, std::move( value ) );
|
||||||
}
|
}
|
||||||
@ -6810,7 +6818,15 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
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 ) );
|
return std::make_tuple( result, std::move( value ) );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user