| 122 | template <vkb::BindingType bindingType, typename AnchorStructType> |
| 123 | template <typename StructType> |
| 124 | inline StructType const *StructureChainBuilder<bindingType, AnchorStructType>::get_struct_impl(size_t skip) const |
| 125 | { |
| 126 | assert(!skip || StructType::allowDuplicate); // If skip is non-zero, the struct type must allow duplicates in the structure chain |
| 127 | |
| 128 | auto it = std::ranges::find_if(structure_chain, [](auto const &chain_element) { |
| 129 | return std::any_cast<StructType>(chain_element.get()) != nullptr; |
| 130 | }); |
| 131 | for (size_t i = 0; (i < skip) && (it != structure_chain.end()); ++i) |
| 132 | { |
| 133 | it = std::find_if(std::next(it), structure_chain.end(), [](auto const &chain_element) { |
| 134 | return std::any_cast<StructType>(chain_element.get()) != nullptr; |
| 135 | }); |
| 136 | } |
| 137 | return (it != structure_chain.end()) ? std::any_cast<StructType>(it->get()) : nullptr; |
| 138 | } |
| 139 | |
| 140 | template <vkb::BindingType bindingType, typename AnchorStructType> |
| 141 | inline void StructureChainBuilder<bindingType, AnchorStructType>::set_anchor_struct(AnchorStructType const &anchor_struct) |