aboutsummaryrefslogtreecommitdiff
path: root/trie.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-02-19 02:31:35 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-19 10:18:31 +0100
commit6f3c772939463c97a4a8a8371db42b8f4b181c68 (patch)
treef8010e9e49696505e22cd0dff3bd84089392a240 /trie.h
parentI somehow got stuff to bulid, now it just doesn't link. (diff)
downloadcalp-6f3c772939463c97a4a8a8371db42b8f4b181c68.tar.gz
calp-6f3c772939463c97a4a8a8371db42b8f4b181c68.tar.xz
No idea, to tired.
Diffstat (limited to 'trie.h')
-rw-r--r--trie.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/trie.h b/trie.h
index 880716e8..07c1bce3 100644
--- a/trie.h
+++ b/trie.h
@@ -7,13 +7,11 @@ template <typename T>
struct trie_node {
char c;
T* value = NULL;
- trie_node<T>* next = NULL;
- trie_node<T>* child = NULL;
+ trie_node<T>* next = nullptr;
+ trie_node<T>* child = nullptr;
trie_node (char c);
trie_node (char c, trie_node<T>* next, trie_node<T>* child);
-
- // ~trie_node ();
};
template <class T>
@@ -24,11 +22,10 @@ struct trie {
trie_node<T>* root;
trie ();
- // ~trie ();
int push_back (const char* key, const T&);
- T& operator[] ( char* key );
+ T& operator[] ( const char* key );
bool empty () { return this->root->child == NULL; }
};