aboutsummaryrefslogtreecommitdiff
path: root/src/trie.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/trie.h')
-rw-r--r--src/trie.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/trie.h b/src/trie.h
index 46fcb4b..d4763ef 100644
--- a/src/trie.h
+++ b/src/trie.h
@@ -51,6 +51,19 @@ class Trie {
}
}
+ inline bool set(key_list path, Value value) {
+ std::pair<bool, Trie*> tmp(this->resolve(path));
+
+ if ( tmp.first ) {
+ tmp.second->value_.first = true;
+ tmp.second->value_.second = value;
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
private:
std::pair<bool, Value> value_;
std::map<Key, Trie> children_;