hashtable: add const
[cdsspec-compiler.git] / hashtable.h
index 6bf813520f505bdb6799f9e2e619510df6e1b7ed..016d4925215c7158f0dc7267d5c2a6136668850e 100644 (file)
@@ -124,7 +124,7 @@ template<typename _Key, typename _Val, typename _KeyInt, int _Shift = 0, void *
        }
 
        /** Lookup the corresponding value for the given key. */
-       _Val get(_Key key) {
+       _Val get(_Key key) const {
                struct hashlistnode<_Key, _Val> *search;
 
                unsigned int index = ((_KeyInt)key) >> _Shift;
@@ -140,7 +140,7 @@ template<typename _Key, typename _Val, typename _KeyInt, int _Shift = 0, void *
        }
 
        /** Check whether the table contains a value for the given key. */
-       bool contains(_Key key) {
+       bool contains(_Key key) const {
                struct hashlistnode<_Key, _Val> *search;
 
                unsigned int index = ((_KeyInt)key) >> _Shift;