summaryrefslogtreecommitdiff
path: root/Build/source/utils/lcdf-typetools/include/lcdf/hashmap.hh
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-11-26 01:57:09 +0000
committerKarl Berry <karl@freefriends.org>2006-11-26 01:57:09 +0000
commit31ff7ecb412ee470d0464bb210a0e9adabed065a (patch)
tree3a6d93ad2c99327f924b7b916db51314d98572b0 /Build/source/utils/lcdf-typetools/include/lcdf/hashmap.hh
parentbc57bba3992e10b518e1578cef31afba9b226bfa (diff)
update to lcdf-typetools 2.46
git-svn-id: svn://tug.org/texlive/trunk@2536 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/lcdf-typetools/include/lcdf/hashmap.hh')
-rw-r--r--Build/source/utils/lcdf-typetools/include/lcdf/hashmap.hh58
1 files changed, 33 insertions, 25 deletions
diff --git a/Build/source/utils/lcdf-typetools/include/lcdf/hashmap.hh b/Build/source/utils/lcdf-typetools/include/lcdf/hashmap.hh
index c1f1339b976..10b5c321177 100644
--- a/Build/source/utils/lcdf-typetools/include/lcdf/hashmap.hh
+++ b/Build/source/utils/lcdf-typetools/include/lcdf/hashmap.hh
@@ -19,6 +19,30 @@
template <class K, class V> class _HashMap_const_iterator;
template <class K, class V> class _HashMap_iterator;
+inline unsigned
+hashcode(int i)
+{
+ return static_cast<unsigned>(i);
+}
+
+inline unsigned
+hashcode(unsigned u)
+{
+ return u;
+}
+
+inline unsigned
+hashcode(long l)
+{
+ return static_cast<unsigned>(l);
+}
+
+inline unsigned
+hashcode(unsigned long ul)
+{
+ return static_cast<unsigned long>(ul);
+}
+
template <class K, class V>
class HashMap { public:
@@ -43,7 +67,8 @@ class HashMap { public:
inline const V &find(const K &) const;
inline V *findp(const K &) const;
inline const V &operator[](const K &k) const;
- V &find_force(const K &);
+ V &find_force(const K &, const V &);
+ inline V &find_force(const K &);
bool insert(const K &, const V &);
void clear();
@@ -154,6 +179,13 @@ HashMap<K, V>::findp(const K &key) const
}
template <class K, class V>
+inline V &
+HashMap<K, V>::find_force(const K &key)
+{
+ return find_force(key, _default_value);
+}
+
+template <class K, class V>
inline _HashMap_const_iterator<K, V>
HashMap<K, V>::begin() const
{
@@ -195,29 +227,5 @@ _HashMap_const_iterator<K, V>::operator!=(const const_iterator &i) const
return _hm != i._hm || _pos != i._pos;
}
-inline unsigned
-hashcode(int i)
-{
- return static_cast<unsigned>(i);
-}
-
-inline unsigned
-hashcode(unsigned u)
-{
- return u;
-}
-
-inline unsigned
-hashcode(long l)
-{
- return static_cast<unsigned>(l);
-}
-
-inline unsigned
-hashcode(unsigned long ul)
-{
- return static_cast<unsigned long>(ul);
-}
-
#include <lcdf/hashmap.cc> // necessary to support GCC 3.3
#endif