Skip to content

Commit 18f984d

Browse files
committed
Until c++17
1 parent 3f9b61c commit 18f984d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jsrc/conversions.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,9 @@ jtbcvt(J jt, C mode, array w) -> array {
558558
array result = w;
559559
if ((((AN(w) - 1) | ((AT(w) & CMPX) - 1))) >= 0) { // not empty AND complex
560560
Z *wv = pointer_to_values<Z>(w);
561-
auto flags = std::transform_reduce(wv, wv + AN(w), int64_t{}, std::plus{}, isflag);
561+
// FIXME: get proper c++17 support
562+
// auto flags = std::transform_reduce(wv, wv + AN(w), int64_t{}, std::plus{}, isflag);
563+
auto flags = std::accumulate(wv, wv + AN(w), int64_t{}, [&](auto sum, auto v) { return sum + isflag(v); });
562564
if (flags) {
563565
I ipok = SGNIF(jtinplace, JTINPLACEWX) & AC(w); // both sign bits set (<0) if inplaceable
564566
if (flags == AN(w)) {

0 commit comments

Comments
 (0)