Skip to content

Commit

Permalink
Dictionnary : declare is_frozen() and containt() as const (#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
FilippoC authored and neubig committed Jun 20, 2018
1 parent 3e3e6a1 commit 66b5175
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dynet/dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ typedef std::unordered_map<std::string, int> Map;

inline unsigned size() const { return (unsigned)words_.size(); }

inline bool contains(const std::string& words) {
inline bool contains(const std::string& words) const {
return !(d_.find(words) == d_.end());
}

void freeze() { frozen = true; }
bool is_frozen() { return frozen; }
bool is_frozen() const { return frozen; }

inline int convert(const std::string& word) {
auto i = d_.find(word);
Expand Down

0 comments on commit 66b5175

Please sign in to comment.