mirror of
https://github.com/abseil/abseil-cpp.git
synced 2026-06-04 12:07:05 +08:00
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
This commit is contained in:
committed by
Copybara-Service
parent
0710718aca
commit
3eb2041985
@@ -75,8 +75,8 @@ using ContainerIter = decltype(begin(std::declval<C&>()));
|
||||
// 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(
|
||||
|
||||
Reference in New Issue
Block a user