Skip to content

Commit

Permalink
Try another way of throwning.
Browse files Browse the repository at this point in the history
  • Loading branch information
joka921 committed May 17, 2024
1 parent e29b302 commit ac726f0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/global/ValueId.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ class ValueId {
// GROUP BY and BIND operations (for performance reaons). So a join with such
// results will currently lead to wrong results.
constexpr bool operator==(const ValueId& other) const {
AD_FAIL();
throw std::system_error{};
// AD_FAIL();
if (getDatatype() == Datatype::LocalVocabIndex &&
other.getDatatype() == Datatype::LocalVocabIndex) [[unlikely]] {
return *getLocalVocabIndex() == *other.getLocalVocabIndex();
Expand All @@ -145,7 +146,8 @@ class ValueId {
/// doubles in reversed order. This is a direct consequence of comparing the
/// bit representation of these values as unsigned integers.
constexpr auto operator<=>(const ValueId& other) const {
AD_FAIL();
throw std::system_error{};
// AD_FAIL();
if (getDatatype() == Datatype::LocalVocabIndex &&
other.getDatatype() == Datatype::LocalVocabIndex) [[unlikely]] {
return *getLocalVocabIndex() <=> *other.getLocalVocabIndex();
Expand Down Expand Up @@ -186,7 +188,9 @@ class ValueId {
/// single undefined value correctly, but it is very useful for generic code
/// like the `visit` member function.
[[nodiscard]] UndefinedType getUndefined() const noexcept { return {}; }
bool isUndefined() const noexcept { return equalByBits(*this, makeUndefined()); }
bool isUndefined() const noexcept {
return equalByBits(*this, makeUndefined());
}

/// Create a `ValueId` for a double value. The conversion will reduce the
/// precision of the mantissa of an IEEE double precision floating point
Expand Down Expand Up @@ -391,15 +395,14 @@ class ValueId {
}
};

struct IdNoLocalVocab: public ValueId {

struct IdNoLocalVocab : public ValueId {
explicit(false) IdNoLocalVocab(ValueId id) : ValueId{id} {}
IdNoLocalVocab() = default;
bool operator==(const IdNoLocalVocab& other) const {
return getBits() == other.getBits();
}
auto operator<=>(const IdNoLocalVocab& other) const {
return getBits()<=> other.getBits();
return getBits() <=> other.getBits();
}
/// Enable hashing in abseil for `ValueId` (required by `ad_utility::HashSet`
/// and `ad_utility::HashMap`
Expand Down

0 comments on commit ac726f0

Please sign in to comment.