OwningVector.hpp
1 #pragma once
2 #include <score/tools/std/IndirectContainer.hpp>
3 
4 #include <memory>
5 #include <vector>
6 
7 template <
8  template <class, class> class Container, typename T,
9  typename U = std::allocator<std::unique_ptr<T>>>
10 class PtrContainer : Container<std::unique_ptr<T>, U>
11 {
12 public:
13  using ctnr_t = Container<std::unique_ptr<T>, U>;
14  using ctnr_t::ctnr_t;
15  using ctnr_t::emplace_back;
16 
17  auto begin() { return score::make_indirect_iterator(ctnr_t::begin()); }
18  auto end() { return score::make_indirect_iterator(ctnr_t::end()); }
19  auto begin() const { return score::make_indirect_iterator(ctnr_t::begin()); }
20  auto end() const { return score::make_indirect_iterator(ctnr_t::end()); }
21  auto cbegin() const { return score::make_indirect_iterator(ctnr_t::cbegin()); }
22  auto cend() const { return score::make_indirect_iterator(ctnr_t::cend()); }
23 };
24 
25 template <typename T>
Definition: OwningVector.hpp:11