Skip to content

Commit

Permalink
pure const contains
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan committed Nov 13, 2020
1 parent dced0d9 commit 50b8fd4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/dict.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ struct Dict
throw std::runtime_error("cppdict: not a map or not default");
}

bool contains(std::string key) { return isNode() and std::get<node_t>(data).count(key); }
bool contains(std::string const key) const noexcept
{
return isNode() and std::get<node_t>(data).count(key);
}

std::size_t size() const noexcept
{
Expand Down

0 comments on commit 50b8fd4

Please sign in to comment.