Add missing const-qualifier in the static_cast in function T const & StructureChain::getFeatures2() const.

This commit is contained in:
asuessenbach 2020-11-09 09:55:45 +01:00
parent 7abf60533a
commit e159e685d4
3 changed files with 5 additions and 3 deletions

View File

@ -10435,7 +10435,7 @@ int main( int argc, char ** argv )
template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
T const & get() const VULKAN_HPP_NOEXCEPT
{
return std::get<ChainElementIndex<0, T, Which, void, ChainElements...>::value>( static_cast<std::tuple<ChainElements...>&>( *this ) );
return std::get<ChainElementIndex<0, T, Which, void, ChainElements...>::value>( static_cast<std::tuple<ChainElements...> const &>( *this ) );
}
template <typename T0, typename T1, typename... Ts>

View File

@ -55,7 +55,9 @@ int main( int /*argc*/, char ** /*argv*/ )
// some valid StructureChains
vk::StructureChain<vk::PhysicalDeviceProperties2> sc0;
vk::StructureChain<vk::PhysicalDeviceProperties2, vk::PhysicalDeviceIDProperties> sc1;
const vk::StructureChain<vk::PhysicalDeviceProperties2, vk::PhysicalDeviceIDProperties> sc1;
auto pdp = sc1.get<vk::PhysicalDeviceProperties2>();
unused( pdp );
vk::StructureChain<vk::PhysicalDeviceProperties2, vk::PhysicalDeviceMaintenance3Properties> sc2;
vk::StructureChain<vk::PhysicalDeviceProperties2, vk::PhysicalDevicePushDescriptorPropertiesKHR> sc3;
vk::StructureChain<vk::PhysicalDeviceProperties2,

View File

@ -978,7 +978,7 @@ namespace VULKAN_HPP_NAMESPACE
T const & get() const VULKAN_HPP_NOEXCEPT
{
return std::get<ChainElementIndex<0, T, Which, void, ChainElements...>::value>(
static_cast<std::tuple<ChainElements...> &>( *this ) );
static_cast<std::tuple<ChainElements...> const &>( *this ) );
}
template <typename T0, typename T1, typename... Ts>