Avoid requiring default-constructability of iterator type in algorithms that use ContainerIterPairType This includes absl::c_minmax_element, absl::c_equal_range, and absl::mismatch PiperOrigin-RevId: 756846820 Change-Id: I39f612224a98947f5ef9e9b7e53320df0bd99ce7
diff --git a/absl/algorithm/container.h b/absl/algorithm/container.h index 913268d..6f9c193 100644 --- a/absl/algorithm/container.h +++ b/absl/algorithm/container.h
@@ -75,8 +75,8 @@ // An MSVC bug involving template parameter substitution requires us to use // decltype() here instead of just std::pair. template <typename C1, typename C2> -using ContainerIterPairType = - decltype(std::make_pair(ContainerIter<C1>(), ContainerIter<C2>())); +using ContainerIterPairType = decltype(std::make_pair( + std::declval<ContainerIter<C1>>(), std::declval<ContainerIter<C2>>())); template <typename C> using ContainerDifferenceType = decltype(std::distance(