From 9aeefce80183a6e399ed45865ac9257ed29d2379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 30 Dec 2020 22:58:31 +0100 Subject: [PATCH] doc: document the need for & / && CreateInfo setter overloads. --- doc/developers.dox | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/developers.dox b/doc/developers.dox index 6b34d4be4..24aefd1e0 100644 --- a/doc/developers.dox +++ b/doc/developers.dox @@ -810,6 +810,14 @@ unless it doesn't affect public API at all. handles), it should be made move-only with the `other._info` members pointing to the stolen state cleared so the old instance doesn't reference state that's owned by something else after the move. + - Additionally, if a move-only class needs to be itself moved into a + containing structure (such as @ref Vk::SubpassDescription inside a + @ref Vk::RenderPassCreateInfo), all its setters should have @cpp & @ce + and @cpp && @ce overloads so it can be set up completely and passed to + its destination in a single expression without any explicit + @cpp std::move() @ce. The overloads can be tested for correctness + rather easily, see `RenderPassTest::subpassDescriptionRvalue()` for an + example. @section developers-vk-extension-dependent Checklist for Vulkan extension-dependent code paths