The code below demonstrates how to access underlying range iterator by transformed iterator:
struct A
{
int x;
};
struct B
{
A* a;
};
std::vector<B> v;
int main()
{
auto a_range = v | std::views::transform(std::mem_fn(&B::a));
auto i = std::ranges::find(a_range.begin(), a_range.end(), 5, std::mem_fn(&A::x));
A* a = *i;
B& b = *(i.base());
}
https://stackoverflow.com/questions/65912645/is-there-any-possible-way-to-get-origin-value-using-transformed-iterator
It’s possible to get an iterator to the underlying range by calling .base().