mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-16 07:23:16 -04:00
Add specializations of std::tuple_element and std::tuple_size for vk::StructureChain. (#1602)
This commit is contained in:
parent
13808e5875
commit
389d1250cd
@ -244,3 +244,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// interupt the VULKAN_HPP_NAMESPACE for a moment to add specializations of std::tuple_size and std::tuple_element for the StructureChain!
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename... Elements>
|
||||||
|
struct tuple_size<VULKAN_HPP_NAMESPACE::StructureChain<Elements...>>
|
||||||
|
{
|
||||||
|
static constexpr size_t value = std::tuple_size<std::tuple<Elements...>>::value;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <std::size_t Index, typename... Elements>
|
||||||
|
struct tuple_element<Index, VULKAN_HPP_NAMESPACE::StructureChain<Elements...>>
|
||||||
|
{
|
||||||
|
using type = typename std::tuple_element<Index, std::tuple<Elements...>>::type;
|
||||||
|
};
|
||||||
|
} // namespace std
|
||||||
|
|
||||||
|
namespace VULKAN_HPP_NAMESPACE
|
||||||
|
{
|
||||||
|
@ -67,13 +67,19 @@ int main( int /*argc*/, char ** /*argv*/ )
|
|||||||
vk::PhysicalDevicePushDescriptorPropertiesKHR>
|
vk::PhysicalDevicePushDescriptorPropertiesKHR>
|
||||||
sc7;
|
sc7;
|
||||||
|
|
||||||
#if !defined(NDEBUG)
|
#if ( 17 <= VULKAN_HPP_CPP_VERSION )
|
||||||
|
// test for structured binding from a StructureChain
|
||||||
|
auto const & [p0, p1] = sc1;
|
||||||
|
auto & [p2, p3] = sc2;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined( NDEBUG )
|
||||||
void * pNext = sc7.get<vk::PhysicalDeviceIDProperties>().pNext;
|
void * pNext = sc7.get<vk::PhysicalDeviceIDProperties>().pNext;
|
||||||
#endif
|
#endif
|
||||||
sc7.assign<vk::PhysicalDeviceIDProperties>( {} );
|
sc7.assign<vk::PhysicalDeviceIDProperties>( {} );
|
||||||
assert( pNext == sc7.get<vk::PhysicalDeviceIDProperties>().pNext );
|
assert( pNext == sc7.get<vk::PhysicalDeviceIDProperties>().pNext );
|
||||||
|
|
||||||
#if !defined(NDEBUG)
|
#if !defined( NDEBUG )
|
||||||
void * pNext1 = sc7.get<vk::PhysicalDeviceMaintenance3Properties>().pNext;
|
void * pNext1 = sc7.get<vk::PhysicalDeviceMaintenance3Properties>().pNext;
|
||||||
#endif
|
#endif
|
||||||
sc7.assign<vk::PhysicalDeviceMaintenance3Properties>( {} ).assign<vk::PhysicalDeviceIDProperties>( {} );
|
sc7.assign<vk::PhysicalDeviceMaintenance3Properties>( {} ).assign<vk::PhysicalDeviceIDProperties>( {} );
|
||||||
|
@ -1181,6 +1181,27 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// interupt the VULKAN_HPP_NAMESPACE for a moment to add specializations of std::tuple_size and std::tuple_element for the StructureChain!
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <typename... Elements>
|
||||||
|
struct tuple_size<VULKAN_HPP_NAMESPACE::StructureChain<Elements...>>
|
||||||
|
{
|
||||||
|
static constexpr size_t value = std::tuple_size<std::tuple<Elements...>>::value;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <std::size_t Index, typename... Elements>
|
||||||
|
struct tuple_element<Index, VULKAN_HPP_NAMESPACE::StructureChain<Elements...>>
|
||||||
|
{
|
||||||
|
using type = typename std::tuple_element<Index, std::tuple<Elements...>>::type;
|
||||||
|
};
|
||||||
|
} // namespace std
|
||||||
|
|
||||||
|
namespace VULKAN_HPP_NAMESPACE
|
||||||
|
{
|
||||||
|
|
||||||
# if !defined( VULKAN_HPP_NO_SMART_HANDLE )
|
# if !defined( VULKAN_HPP_NO_SMART_HANDLE )
|
||||||
template <typename Type, typename Dispatch>
|
template <typename Type, typename Dispatch>
|
||||||
class UniqueHandleTraits;
|
class UniqueHandleTraits;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user