Wayverb
iterator.h
1 #pragma once
2 
3 #include "core/cl/scene_structs.h"
4 
5 #include "utilities/mapping_iterator_adapter.h"
6 
7 #include <iterator>
8 #include <type_traits>
9 
10 namespace wayverb {
11 namespace core {
12 
13 namespace detail {
14 
15 class cl_type_index_mapper final {
16 public:
17  cl_type_index_mapper(size_t index)
18  : index_(index) {}
19 
20  template <typename T>
21  constexpr auto& operator()(T& t) const {
22  return t.s[index_];
23  }
24 
25 private:
26  size_t index_{0};
27 };
28 
29 } // namespace detail
30 
35 template <typename It>
36 using cl_type_iterator =
38 
41 template <class It>
42 constexpr cl_type_iterator<It> make_cl_type_iterator(It it, size_t index) {
43  return util::make_mapping_iterator_adapter(
44  std::move(it), detail::cl_type_index_mapper{index});
45 }
46 
47 } // namespace core
48 } // namespace wayverb
Definition: traits.cpp:2
Definition: traits.h:46
Definition: capsule_base.h:9
Definition: mapping_iterator_adapter.h:15