Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
martinus committed Jan 16, 2020
1 parent 165dad2 commit 23e052f
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/test/unit/unit_undefined_behavior_nekrolm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct IntegralState {
return value == other.value;
}

inline size_t Hash() const noexcept {
ROBIN_HOOD(NODISCARD) inline size_t Hash() const noexcept {
static const robin_hood::hash<T> hasher;
return hasher(value);
}
Expand All @@ -67,10 +67,10 @@ struct StatePair {
: first_state(f)
, second_state(s) {}

inline const First& FirstState() const noexcept {
ROBIN_HOOD(NODISCARD) inline const First& FirstState() const noexcept {
return first_state;
}
inline const Second& SecondState() const noexcept {
ROBIN_HOOD(NODISCARD) inline const Second& SecondState() const noexcept {
return second_state;
}

Expand All @@ -83,7 +83,7 @@ struct StatePair {
: first_state < other.first_state;
}

inline size_t Hash() const noexcept {
ROBIN_HOOD(NODISCARD) inline size_t Hash() const noexcept {
return CombineHashes(second_state.Hash(), first_state.Hash());
}
};
Expand All @@ -102,7 +102,7 @@ struct StatePair<First, VoidState> {
inline StatePair(First f, VoidState ROBIN_HOOD_UNUSED(x) /*unused*/) noexcept
: first_state(std::move(f)) {}

inline const First& FirstState() const noexcept {
ROBIN_HOOD(NODISCARD) inline const First& FirstState() const noexcept {
return first_state;
}
inline static VoidState SecondState() noexcept {
Expand All @@ -117,7 +117,7 @@ struct StatePair<First, VoidState> {
return first_state < other.first_state;
}

inline size_t Hash() const noexcept {
ROBIN_HOOD(NODISCARD) inline size_t Hash() const noexcept {
return first_state.Hash();
}
};
Expand All @@ -128,7 +128,7 @@ struct StatePair<VoidState, Second> {
Second second_state{};

public:
inline StatePair(VoidState ROBIN_HOOD_UNUSED(x) /*unused*/, Second s) noexcept
explicit inline StatePair(VoidState ROBIN_HOOD_UNUSED(x) /*unused*/, Second s) noexcept
: second_state(std::move(s)) {}

inline StatePair() noexcept = default;
Expand All @@ -148,7 +148,7 @@ struct StatePair<VoidState, Second> {
return second_state < other.second_state;
}

inline size_t Hash() const noexcept {
ROBIN_HOOD(NODISCARD) inline size_t Hash() const noexcept {
return second_state.Hash();
}
};
Expand Down Expand Up @@ -181,7 +181,7 @@ class FstStatePair {
: inner_state < other.inner_state;
}

size_t Hash() const noexcept {
ROBIN_HOOD(NODISCARD) size_t Hash() const noexcept {
static const robin_hood::hash<uint64_t> hasher;
return hasher((static_cast<uint64_t>(inner_state) << 32U) |
static_cast<uint32_t>(outer_state));
Expand All @@ -208,7 +208,9 @@ TEST_CASE_TEMPLATE("undefined_behavior_nekrolm", Map, robin_hood::unordered_flat

for (int i = 0; i < 1000; ++i) {
for (int j = 0; j < 1000; ++j) {
IState s = {{i, j}, FState{}};
FstStatePair lhs(i, j);
FState rhs{};
IState s(lhs, rhs);
map[s] = static_cast<int>(map.size());
}
}
Expand Down

0 comments on commit 23e052f

Please sign in to comment.