14template <
typename Element>
17template <
typename Element>
74 iterator.n_ += increment;
82 iterator.n_ += increment;
89 assert(
view_ == other.view_);
97 iterator.n_ -= decrement;
116template <
typename Element>
127 return {
size(),
this};
130 [[nodiscard]]
virtual std::size_t
size() const noexcept = 0;
132 [[nodiscard]] virtual Element& operator[](std::
size_t) const = 0;
137template <typename Element, typename Container>
148 if constexpr (
requires {
149 typename Container::value_type::element_type;
153 std::derived_from<
typename Container::value_type::element_type,
161 std::derived_from<typename Container::value_type, Element>);
166 (!std::is_const_v<Container>) || std::is_const_v<Element>,
167 "If the element type is non-const, the container must be "
210template <
typename Element>
218 template <
typename Container>
222 :
impl_{std::make_unique<
228 template <
typename Container>
232 :
impl_{std::make_unique<
247 return impl_->begin();
255 [[nodiscard]] std::size_t
size() const noexcept {
return impl_->size(); }
detail::PolymorphicRandomAccessContainerViewIterator< Element > end() const noexcept
detail::PolymorphicRandomAccessContainerViewIterator< Element > begin() const noexcept
PolymorphicRandomAccessContainerView(PolymorphicRandomAccessContainerView const &)=delete
std::size_t size() const noexcept
Element & operator[](std::size_t n) const
PolymorphicRandomAccessContainerView(PolymorphicRandomAccessContainerView &&)=default
PolymorphicRandomAccessContainerView & operator=(PolymorphicRandomAccessContainerView &&)=default
std::unique_ptr< detail::PolymorphicRandomAccessContainerViewInterface< Element > > impl_
PolymorphicRandomAccessContainerView & operator=(PolymorphicRandomAccessContainerView const &)=delete
CovariantRandomAccessContainerView(Container &container)
Element & operator[](std::size_t index) const override
std::size_t size() const noexcept override
PolymorphicRandomAccessContainerViewIterator< Element > end() const noexcept
virtual std::size_t size() const noexcept=0
PolymorphicRandomAccessContainerViewIterator< Element > begin() const noexcept
PolymorphicRandomAccessContainerViewIterator & operator+=(difference_type const increment) noexcept
friend PolymorphicRandomAccessContainerViewIterator operator+(PolymorphicRandomAccessContainerViewIterator iterator, difference_type const increment) noexcept
PolymorphicRandomAccessContainerViewIterator(std::size_t n, PolymorphicRandomAccessContainerViewInterface< Element > const *const view) noexcept
friend PolymorphicRandomAccessContainerViewIterator operator-(PolymorphicRandomAccessContainerViewIterator iterator, difference_type const decrement) noexcept
PolymorphicRandomAccessContainerViewIterator & operator++() noexcept
Element & operator[](difference_type n) const
difference_type operator-(PolymorphicRandomAccessContainerViewIterator const other) const noexcept
PolymorphicRandomAccessContainerViewIterator()=default
PolymorphicRandomAccessContainerViewInterface< Element > const * view_
PolymorphicRandomAccessContainerViewIterator operator++(int) noexcept
auto operator<=>(PolymorphicRandomAccessContainerViewIterator const &) const =default
std::ptrdiff_t difference_type
PolymorphicRandomAccessContainerViewIterator operator--(int) noexcept
PolymorphicRandomAccessContainerViewIterator & operator-=(difference_type const decrement) noexcept
friend PolymorphicRandomAccessContainerViewIterator operator+(difference_type const increment, PolymorphicRandomAccessContainerViewIterator iterator) noexcept
Element & operator*() const
PolymorphicRandomAccessContainerViewIterator & operator--() noexcept