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

Commit

Permalink
add nodiscard
Browse files Browse the repository at this point in the history
  • Loading branch information
martinus committed Feb 29, 2020
1 parent 1c0413a commit 915b7ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/include/robin_hood.h
Original file line number Diff line number Diff line change
Expand Up @@ -1887,13 +1887,15 @@ class Table

private:
template <typename Q = mapped_type>
ROBIN_HOOD(NODISCARD)
typename std::enable_if<!std::is_void<Q>::value, bool>::type has(const value_type& e) const {
ROBIN_HOOD_TRACE(this);
auto it = find(e.first);
return it != end() && it->second == e.second;
}

template <typename Q = mapped_type>
ROBIN_HOOD(NODISCARD)
typename std::enable_if<std::is_void<Q>::value, bool>::type has(const value_type& e) const {
ROBIN_HOOD_TRACE(this);
return find(e) != end();
Expand Down

0 comments on commit 915b7ab

Please sign in to comment.