2#ifndef LIBSBX_MEMORY_ITERABLE_ADAPTOR_HPP_
3#define LIBSBX_MEMORY_ITERABLE_ADAPTOR_HPP_
10template<std::forward_iterator Iterator, std::sentinel_for<Iterator> Sentinel = Iterator>
15 using value_type =
typename std::iterator_traits<Iterator>::value_type;
16 using iterator = Iterator;
17 using sentinel = Sentinel;
19 constexpr iterable_adaptor()
noexcept(std::is_nothrow_default_constructible_v<iterator> && std::is_nothrow_default_constructible_v<sentinel>)
23 constexpr iterable_adaptor(iterator from, sentinel to)
noexcept(std::is_nothrow_move_constructible_v<iterator> && std::is_nothrow_move_constructible_v<sentinel>)
24 : _first{std::move(from)},
25 _last{std::move(to)} { }
27 [[nodiscard]]
constexpr auto begin()
const noexcept -> iterator {
31 [[nodiscard]]
constexpr auto end()
const noexcept -> sentinel {
35 [[nodiscard]]
constexpr auto cbegin()
const noexcept -> iterator {
39 [[nodiscard]]
constexpr auto cend()
const noexcept -> sentinel {
50template<
typename Type>
55 using value_type = Type;
56 using pointer = Type *;
57 using reference = Type &;
59 constexpr input_iterator_pointer(value_type&& value)
noexcept(std::is_nothrow_move_constructible_v<value_type>)
60 : _value{std::move(value)} {}
62 [[nodiscard]]
constexpr auto operator->()
noexcept -> pointer {
63 return std::addressof(_value);
66 [[nodiscard]]
constexpr auto operator*()
noexcept -> reference {
Definition: iterable_adaptor.hpp:11