Skip to content

Commit

Permalink
Merge pull request LaboratoryOfPlasmaPhysics#14 from Dekken/const
Browse files Browse the repository at this point in the history
pure const contains
  • Loading branch information
PhilipDeegan authored Nov 16, 2020
2 parents dced0d9 + 50b8fd4 commit 6b02756
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 6b02756

Please sign in to comment.