Introduce default template type for functions StructureChain::get<T,Which>

allows
    auto root = structureChain.get();
instead of
    auto root = structureChain.get<RootStructure>();
This commit is contained in:
asuessenbach 2020-10-20 15:47:57 +02:00
parent 2ccc36b26b
commit 80fa34bfb5
2 changed files with 4 additions and 4 deletions

View File

@ -10750,13 +10750,13 @@ int main( int argc, char ** argv )
StructureChain & operator=( StructureChain && rhs ) = delete;
template <typename T, size_t Which = 0>
template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
T & get() VULKAN_HPP_NOEXCEPT
{
return std::get<ChainElementIndex<0, T, Which, void, ChainElements...>::value>( static_cast<std::tuple<ChainElements...>&>( *this ) );
}
template <typename T, size_t Which = 0>
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 ) );

View File

@ -970,14 +970,14 @@ namespace VULKAN_HPP_NAMESPACE
StructureChain & operator=( StructureChain && rhs ) = delete;
template <typename T, size_t Which = 0>
template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
T & get() VULKAN_HPP_NOEXCEPT
{
return std::get<ChainElementIndex<0, T, Which, void, ChainElements...>::value>(
static_cast<std::tuple<ChainElements...> &>( *this ) );
}
template <typename T, size_t Which = 0>
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>(