Skip to content

Commit

Permalink
Remove move-constructor and deleted move-assignment of vk::StructureC…
Browse files Browse the repository at this point in the history
…hain. (#1949)
  • Loading branch information
asuessenbach authored Aug 26, 2024
1 parent 1069a08 commit ecd4b59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
13 changes: 2 additions & 11 deletions snippets/StructureChain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
template <typename... ChainElements>
class StructureChain : public std::tuple<ChainElements...>
{
// Note: StructureChain has no move constructor or move assignment operator, as it is not supposed to contain movable containers.
// In order to get a copy-operation on a move-operations, those functions are neither deleted nor defaulted.
public:
StructureChain() VULKAN_HPP_NOEXCEPT
{
Expand All @@ -66,15 +68,6 @@
reinterpret_cast<VkBaseInStructure const *>( &std::get<0>( rhs ) ) );
}

StructureChain( StructureChain && rhs ) VULKAN_HPP_NOEXCEPT : std::tuple<ChainElements...>( std::forward<std::tuple<ChainElements...>>( rhs ) )
{
static_assert( StructureChainValidation<sizeof...( ChainElements ) - 1, ChainElements...>::valid, "The structure chain is not valid!" );
link( &std::get<0>( *this ),
&std::get<0>( rhs ),
reinterpret_cast<VkBaseOutStructure *>( &std::get<0>( *this ) ),
reinterpret_cast<VkBaseInStructure const *>( &std::get<0>( rhs ) ) );
}

StructureChain( ChainElements const &... elems ) VULKAN_HPP_NOEXCEPT : std::tuple<ChainElements...>( elems... )
{
static_assert( StructureChainValidation<sizeof...( ChainElements ) - 1, ChainElements...>::valid, "The structure chain is not valid!" );
Expand All @@ -91,8 +84,6 @@
return *this;
}

StructureChain & operator=( StructureChain && rhs ) = delete;

template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
T & get() VULKAN_HPP_NOEXCEPT
{
Expand Down
13 changes: 2 additions & 11 deletions vulkan/vulkan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,8 @@ namespace VULKAN_HPP_NAMESPACE
template <typename... ChainElements>
class StructureChain : public std::tuple<ChainElements...>
{
// Note: StructureChain has no move constructor or move assignment operator, as it is not supposed to contain movable containers.
// In order to get a copy-operation on a move-operations, those functions are neither deleted nor defaulted.
public:
StructureChain() VULKAN_HPP_NOEXCEPT
{
Expand All @@ -624,15 +626,6 @@ namespace VULKAN_HPP_NAMESPACE
reinterpret_cast<VkBaseInStructure const *>( &std::get<0>( rhs ) ) );
}

StructureChain( StructureChain && rhs ) VULKAN_HPP_NOEXCEPT : std::tuple<ChainElements...>( std::forward<std::tuple<ChainElements...>>( rhs ) )
{
static_assert( StructureChainValidation<sizeof...( ChainElements ) - 1, ChainElements...>::valid, "The structure chain is not valid!" );
link( &std::get<0>( *this ),
&std::get<0>( rhs ),
reinterpret_cast<VkBaseOutStructure *>( &std::get<0>( *this ) ),
reinterpret_cast<VkBaseInStructure const *>( &std::get<0>( rhs ) ) );
}

StructureChain( ChainElements const &... elems ) VULKAN_HPP_NOEXCEPT : std::tuple<ChainElements...>( elems... )
{
static_assert( StructureChainValidation<sizeof...( ChainElements ) - 1, ChainElements...>::valid, "The structure chain is not valid!" );
Expand All @@ -649,8 +642,6 @@ namespace VULKAN_HPP_NAMESPACE
return *this;
}

StructureChain & operator=( StructureChain && rhs ) = delete;

template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
T & get() VULKAN_HPP_NOEXCEPT
{
Expand Down
13 changes: 2 additions & 11 deletions vulkan/vulkansc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,8 @@ namespace VULKAN_HPP_NAMESPACE
template <typename... ChainElements>
class StructureChain : public std::tuple<ChainElements...>
{
// Note: StructureChain has no move constructor or move assignment operator, as it is not supposed to contain movable containers.
// In order to get a copy-operation on a move-operations, those functions are neither deleted nor defaulted.
public:
StructureChain() VULKAN_HPP_NOEXCEPT
{
Expand All @@ -624,15 +626,6 @@ namespace VULKAN_HPP_NAMESPACE
reinterpret_cast<VkBaseInStructure const *>( &std::get<0>( rhs ) ) );
}

StructureChain( StructureChain && rhs ) VULKAN_HPP_NOEXCEPT : std::tuple<ChainElements...>( std::forward<std::tuple<ChainElements...>>( rhs ) )
{
static_assert( StructureChainValidation<sizeof...( ChainElements ) - 1, ChainElements...>::valid, "The structure chain is not valid!" );
link( &std::get<0>( *this ),
&std::get<0>( rhs ),
reinterpret_cast<VkBaseOutStructure *>( &std::get<0>( *this ) ),
reinterpret_cast<VkBaseInStructure const *>( &std::get<0>( rhs ) ) );
}

StructureChain( ChainElements const &... elems ) VULKAN_HPP_NOEXCEPT : std::tuple<ChainElements...>( elems... )
{
static_assert( StructureChainValidation<sizeof...( ChainElements ) - 1, ChainElements...>::valid, "The structure chain is not valid!" );
Expand All @@ -649,8 +642,6 @@ namespace VULKAN_HPP_NAMESPACE
return *this;
}

StructureChain & operator=( StructureChain && rhs ) = delete;

template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
T & get() VULKAN_HPP_NOEXCEPT
{
Expand Down

0 comments on commit ecd4b59

Please sign in to comment.