Skip to content

Commit ac1a4e5

Browse files
authored
Merge pull request #219 from elbeno/fix-destructure
2 parents c886105 + d578612 commit ac1a4e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/stdx/algorithm.hpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,14 @@ CONSTEXPR_INVOKE auto initial_medial_final(FwdIt first, FwdIt last, IOp iop,
127127
-> for_each_result<IOp, MOp, FOp> {
128128
if (first != last) {
129129
iop(*first);
130-
auto [op, it] = for_each_butlast(++first, last, mop);
131-
if (it != last) {
130+
auto r = for_each_butlast(++first, last, mop);
131+
#if __cplusplus < 202002L
132+
using std::get;
133+
#endif
134+
if (auto it = get<1>(r); it != last) {
132135
fop(*it);
133136
}
134-
return {iop, op, fop};
137+
return {iop, get<0>(r), fop};
135138
}
136139
return {iop, mop, fop};
137140
}

0 commit comments

Comments
 (0)