It's possible to get an iterator to the underlying range by calling .base()
.
assert(*it.base() == std::tuple{'B', 2});
But it might be more idiomatic to use a projection with std::ranges::find
.
std::vector v{std::tuple{'A', 1}, {'B', 2}, {'C', 3}};
auto it = std::ranges::find(v, 'B', [](auto& e) { return std::get<0>(e); });
assert(*it == std::tuple{'B', 2});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…