Skip to content

Commit 3eb2041

Browse files
Abseil Teamcopybara-github
authored andcommitted
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
1 parent 0710718 commit 3eb2041

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

absl/algorithm/container.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ using ContainerIter = decltype(begin(std::declval<C&>()));
7575
// An MSVC bug involving template parameter substitution requires us to use
7676
// decltype() here instead of just std::pair.
7777
template <typename C1, typename C2>
78-
using ContainerIterPairType =
79-
decltype(std::make_pair(ContainerIter<C1>(), ContainerIter<C2>()));
78+
using ContainerIterPairType = decltype(std::make_pair(
79+
std::declval<ContainerIter<C1>>(), std::declval<ContainerIter<C2>>()));
8080

8181
template <typename C>
8282
using ContainerDifferenceType = decltype(std::distance(

0 commit comments

Comments
 (0)