12#include <rpp/disposables/disposable_wrapper.hpp>
13#include <rpp/utils/exceptions.hpp>
18namespace rpp::details::disposables
38 m_data.push_back(std::move(d));
43 m_data.erase(std::remove(m_data.begin(), m_data.end(), d), m_data.end());
48 for (
const auto& d : m_data)
60 mutable std::vector<rpp::disposable_wrapper> m_data{};
63 template<
size_t Count>
76 m_size = other.m_size;
77 for (
size_t i = 0; i < m_size; ++i)
78 std::construct_at(get(i), std::move(*other.get(i)));
84 static_disposables_container(static_disposables_container&& other)
noexcept
86 *
this = std::move(other);
89 ~static_disposables_container() noexcept
98 std::construct_at(get(m_size++), d);
105 std::construct_at(get(m_size++), std::move(d));
110 for (
size_t i = 0; i < m_size;)
118 for (
size_t j = i + 1; j < m_size; ++j)
119 *get(j - 1) = std::move(*get(j));
121 std::destroy_at(get(--m_size));
127 for (
size_t i = 0; i < m_size; ++i)
135 for (
size_t i = 0; i < m_size; ++i)
136 std::destroy_at(get(i));
165 static void dispose() {}
166 static void clear() {}
Definition container.hpp:21
Container with fixed std::array as underlying storage.
Definition fwd.hpp:65
disposable_wrapper_impl< interface_disposable > disposable_wrapper
Wrapper to keep "simple" disposable. Specialization of rpp::disposable_wrapper_impl.
Definition fwd.hpp:34
Definition exceptions.hpp:23