596 :
public boost::stl_interfaces::proxy_iterator_interface<
597#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS
600 std::random_access_iterator_tag,
604 using base_type = boost::stl_interfaces::proxy_iterator_interface<
605#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS
608 std::random_access_iterator_tag,
610 using difference_type = base_type::difference_type;
612 constexpr Iterator ()
noexcept =
default;
615 constexpr Iterator (std::span<const VariantType>::iterator it) noexcept
621 constexpr Iterator (std::span<const UuidRefType>::iterator it) noexcept
628 std::span<const UuidType>::iterator it,
629 const RegistryT * registry) noexcept
630 : it_var_ (std::pair{ it, registry })
634 constexpr VariantType operator* ()
const
638 using T = std::decay_t<
decltype (arg)>;
640 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
645 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
647 return arg->get_object ();
653 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
655 return arg.second->find_by_id_or_throw (*arg.first);
661 constexpr Iterator &operator+= (difference_type n)
noexcept
665 using T = std::decay_t<
decltype (arg)>;
667 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
672 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
680 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
689 constexpr difference_type operator- (Iterator other)
const
692 [] (
auto &&arg,
auto &&other_arg) -> difference_type {
693 using T = std::decay_t<
decltype (arg)>;
694 using OtherT = std::decay_t<
decltype (other_arg)>;
695 if constexpr (!std::is_same_v<T, OtherT>)
697 throw std::runtime_error (
698 "Comparing iterators of different types");
701 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
703 return arg - other_arg;
706 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
708 return arg - other_arg;
714 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
716 return arg.first - other_arg.first;
723 it_var_, other.it_var_);
726 constexpr auto operator<=> (
const Iterator &other)
const
729 [] (
auto &&arg,
auto &&other_arg) -> std::strong_ordering {
730 using T = std::decay_t<
decltype (arg)>;
731 using OtherT = std::decay_t<
decltype (other_arg)>;
732 if constexpr (!std::is_same_v<T, OtherT>)
734 throw std::runtime_error (
735 "Comparing iterators of different types");
738 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
740 return arg <=> other_arg;
743 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
745 return arg <=> other_arg;
751 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
753 return arg.first <=> other_arg.first;
757 return std::strong_ordering::equal;
760 it_var_, other.it_var_);
765 typename std::span<const VariantType>::iterator,
766 typename std::span<const UuidRefType>::iterator,
767 std::pair<typename std::span<const UuidType>::iterator,
const RegistryT *>>