diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-01-25 16:56:19 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-01-25 16:56:19 +0000 |
commit | e7f4a92bb81c5fabcb12372a180016b996f2c988 (patch) | |
tree | db13bd80b8c4fc5a77372f99a57aab50a7bbf2f2 | |
parent | 0861fdb652408dcdbd2e7b60513f3fa24696e610 (diff) | |
download | libbu++-e7f4a92bb81c5fabcb12372a180016b996f2c988.tar.gz libbu++-e7f4a92bb81c5fabcb12372a180016b996f2c988.tar.bz2 libbu++-e7f4a92bb81c5fabcb12372a180016b996f2c988.tar.xz libbu++-e7f4a92bb81c5fabcb12372a180016b996f2c988.zip |
I had thought that I had done this ages ago. __cacheGetKey now has a general
template definition that just calls getKey() in the object, if the object
doesn't support a getKey() method, then you can write your own, but now you
don't have to.
Diffstat (limited to '')
-rw-r--r-- | src/cache.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cache.h b/src/cache.h index c738d28..f10233b 100644 --- a/src/cache.h +++ b/src/cache.h | |||
@@ -20,6 +20,11 @@ namespace Bu | |||
20 | { | 20 | { |
21 | // template<class keytype, class obtype> | 21 | // template<class keytype, class obtype> |
22 | // keytype __cacheGetKey( obtype *&pObj ); | 22 | // keytype __cacheGetKey( obtype *&pObj ); |
23 | template<class keytype, class obtype> | ||
24 | keytype __cacheGetKey( const obtype *pObj ) | ||
25 | { | ||
26 | return pObj->getKey(); | ||
27 | } | ||
23 | 28 | ||
24 | template<class keytype, class obtype> | 29 | template<class keytype, class obtype> |
25 | class Cache | 30 | class Cache |