640 :
public boost::stl_interfaces::proxy_iterator_interface<
641#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS
644 std::random_access_iterator_tag,
648 using base_type = boost::stl_interfaces::proxy_iterator_interface<
649#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS
652 std::random_access_iterator_tag,
654 using difference_type = base_type::difference_type;
656 constexpr Iterator ()
noexcept =
default;
659 constexpr Iterator (std::span<const VariantType>::iterator it) noexcept
665 constexpr Iterator (std::span<const UuidRefType>::iterator it) noexcept
672 std::span<const UuidType>::iterator it,
673 const RegistryT * registry) noexcept
674 : it_var_ (std::pair{ it, registry })
678 constexpr VariantType operator* ()
const
682 using T = std::decay_t<
decltype (arg)>;
684 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
689 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
691 return arg->get_object ();
697 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
699 return arg.second->find_by_id_or_throw (*arg.first);
705 constexpr Iterator &operator+= (difference_type n)
noexcept
709 using T = std::decay_t<
decltype (arg)>;
711 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
716 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
724 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
733 constexpr difference_type operator- (Iterator other)
const
736 [] (
auto &&arg,
auto &&other_arg) -> difference_type {
737 using T = std::decay_t<
decltype (arg)>;
738 using OtherT = std::decay_t<
decltype (other_arg)>;
739 if constexpr (!std::is_same_v<T, OtherT>)
741 throw std::runtime_error (
742 "Comparing iterators of different types");
745 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
747 return arg - other_arg;
750 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
752 return arg - other_arg;
758 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
760 return arg.first - other_arg.first;
767 it_var_, other.it_var_);
770 constexpr auto operator<=> (
const Iterator &other)
const
773 [] (
auto &&arg,
auto &&other_arg) -> std::strong_ordering {
774 using T = std::decay_t<
decltype (arg)>;
775 using OtherT = std::decay_t<
decltype (other_arg)>;
776 if constexpr (!std::is_same_v<T, OtherT>)
778 throw std::runtime_error (
779 "Comparing iterators of different types");
782 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
784 return arg <=> other_arg;
787 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
789 return arg <=> other_arg;
795 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
797 return arg.first <=> other_arg.first;
801 return std::strong_ordering::equal;
804 it_var_, other.it_var_);
809 typename std::span<const VariantType>::iterator,
810 typename std::span<const UuidRefType>::iterator,
811 std::pair<typename std::span<const UuidType>::iterator,
const RegistryT *>>