Skip to content

Commit

Permalink
Fix backward compatibility for old GNU and except Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin D. Weinberg committed Nov 15, 2024
1 parent 6817c59 commit c245d79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/KDtree.H
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ namespace KDtree
double wgt = 0.0; // Sum weights
for (auto b : best_) wgt += b.second->point_.mass();

#if __GNUC__ > 6
#if __GNUC__ > 6 or defined(__clang__)
return {best_.begin()->second->point_, wgt, std::sqrt(best_.rbegin()->first), best_};
#else
std::tuple<point_type, double, double> ret;
std::tuple<point_type, double, double, cache> ret;
std::get<0>(ret) = best_.begin()->second->point_;
std::get<1>(ret) = wgt;
std::get<2>(ret) = std::sqrt(best_.rbegin()->first);
Expand Down

0 comments on commit c245d79

Please sign in to comment.