602 :
public boost::stl_interfaces::proxy_iterator_interface<
603#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS
606 std::random_access_iterator_tag,
610 using base_type = boost::stl_interfaces::proxy_iterator_interface<
611#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS
614 std::random_access_iterator_tag,
616 using difference_type = base_type::difference_type;
618 constexpr Iterator ()
noexcept =
default;
621 constexpr Iterator (std::span<const VariantType>::iterator it) noexcept
627 constexpr Iterator (std::span<const UuidRefType>::iterator it) noexcept
634 std::span<const UuidType>::iterator it,
635 const RegistryT * registry) noexcept
636 : it_var_ (std::pair{ it, registry })
640 constexpr VariantType operator* ()
const
644 using T = std::decay_t<
decltype (arg)>;
646 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
651 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
653 return arg->get_object ();
659 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
661 return arg.second->find_by_id_or_throw (*arg.first);
667 constexpr Iterator &operator+= (difference_type n)
noexcept
671 using T = std::decay_t<
decltype (arg)>;
673 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
678 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
686 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
695 constexpr difference_type operator- (Iterator other)
const
698 [] (
auto &&arg,
auto &&other_arg) -> difference_type {
699 using T = std::decay_t<
decltype (arg)>;
700 using OtherT = std::decay_t<
decltype (other_arg)>;
701 if constexpr (!std::is_same_v<T, OtherT>)
703 throw std::runtime_error (
704 "Comparing iterators of different types");
707 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
709 return arg - other_arg;
712 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
714 return arg - other_arg;
720 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
722 return arg.first - other_arg.first;
729 it_var_, other.it_var_);
732 constexpr auto operator<=> (
const Iterator &other)
const
735 [] (
auto &&arg,
auto &&other_arg) -> std::strong_ordering {
736 using T = std::decay_t<
decltype (arg)>;
737 using OtherT = std::decay_t<
decltype (other_arg)>;
738 if constexpr (!std::is_same_v<T, OtherT>)
740 throw std::runtime_error (
741 "Comparing iterators of different types");
744 std::is_same_v<T, typename std::span<const VariantType>::iterator>)
746 return arg <=> other_arg;
749 std::is_same_v<T, typename std::span<const UuidRefType>::iterator>)
751 return arg <=> other_arg;
757 typename std::span<const UuidType>::iterator,
const RegistryT *>>)
759 return arg.first <=> other_arg.first;
763 return std::strong_ordering::equal;
766 it_var_, other.it_var_);
771 typename std::span<const VariantType>::iterator,
772 typename std::span<const UuidRefType>::iterator,
773 std::pair<typename std::span<const UuidType>::iterator,
const RegistryT *>>