-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!rangesC++20/23 rangesC++20/23 ranges
Description
Lines 1010 to 1013 in ef62d3f
| const auto _ProjectedPred = [&]<class _Ty1, class _Ty2>(_Ty1&& _Left, _Ty2&& _Right) { | |
| return _STD invoke(_Pred, _STD invoke(_Proj1, _STD forward<_Ty1>(_Left)), | |
| _STD invoke(_Proj2, _STD forward<_Ty2>(_Right))); | |
| }; |
Lines 1099 to 1102 in ef62d3f
| const auto _ProjectedPred = [&]<class _Ty1, class _Ty2>(_Ty1&& _Left, _Ty2&& _Right) { | |
| return _STD invoke(_Pred, _STD invoke(_Proj1, _STD forward<_Ty1>(_Left)), | |
| _STD invoke(_Proj2, _STD forward<_Ty2>(_Right))); | |
| }; |
The lambda needs to specify return type eg -> bool since boolean-testable only requires that the return type of Pred can be converted to bool.
#include <algorithm>
struct Bool {
operator bool() { return true; };
Bool() = default;
Bool(const Bool&) = delete;
};
int main() {
Bool b;
int x[] = {42};
std::ranges::is_permutation(x, x, [&](auto, auto) -> Bool& { return b; });
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!rangesC++20/23 rangesC++20/23 ranges