Skip to content

Commit

Permalink
Add support for brew clang 16
Browse files Browse the repository at this point in the history
- Add fallback behaviour in hymd::utility::MdLessPairs if
  operator <=> for vectors isn't availible
- Add explicit #include <string> in exceptions.h
  • Loading branch information
p-senichenkov committed Dec 22, 2024
1 parent 6533c14 commit 43075ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/algorithms/md/hymd/utility/md_less.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,19 @@ inline bool MdLessPairs(MdPair const& pair_left, MdPair const& pair_right) {
} else if (cardinality_left > cardinality_right) {
return false;
}

#if __cpp_lib_three_way_comparison == 201907L
auto comp = lhs_left <=> lhs_right;
#else
signed char comp;
if (lhs_left < rhs_left) {
comp = -1;
} else if (lhs_left == rhs_left) {
comp = 0;
} else {
comp = 1;
}
#endif
if (comp < 0) {
return true;
} else if (comp > 0) {
Expand Down
1 change: 1 addition & 0 deletions src/core/config/exceptions.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <stdexcept>
#include <string>

namespace config {

Expand Down

0 comments on commit 43075ae

Please sign in to comment.