Skip to content

Commit

Permalink
Add another workaround for Xcode/libc++ issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePopoloski committed Jun 30, 2023
1 parent 28437b4 commit bb9fcb7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions source/numeric/ConstantValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,16 @@ std::partial_ordering operator<=>(const ConstantValue& lhs, const ConstantValue&

return arg <=> std::get<ConstantValue::Elements>(rhs.value);
}
else if constexpr (std::is_same_v<T, std::string>)
return rhs.isString() ? arg <=> rhs.str() : unordered;
else if constexpr (std::is_same_v<T, std::string>) {
// TODO: clean this up once Xcode / libc++ get their act together
if (!rhs.isString())
return unordered;

int cmp = arg.compare(rhs.str());
return cmp < 0 ? std::partial_ordering::less
: cmp == 0 ? std::partial_ordering::equivalent
: std::partial_ordering::greater;
}
else if constexpr (std::is_same_v<T, ConstantValue::Map>) {
if (!rhs.isMap())
return unordered;
Expand Down

0 comments on commit bb9fcb7

Please sign in to comment.