diff options
author | lloyd <[email protected]> | 2010-11-02 13:36:48 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-11-02 13:36:48 +0000 |
commit | fb964299d5f33bea7e48445fc429c16a236ee1c2 (patch) | |
tree | bcba7ffcb5e9835446ab31bd0f6127eac2fac23e /src/utils/stl_util.h | |
parent | ae1803f4983b9b178c32ebfd4f395cf2ccd939c9 (diff) |
Doxygen updates.
Remove version of search_map that returns two distinguishing results;
only used in one place, and that can be replaced by a call to count()
Diffstat (limited to 'src/utils/stl_util.h')
-rw-r--r-- | src/utils/stl_util.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/utils/stl_util.h b/src/utils/stl_util.h index 5a17f46a9..0e0617d5b 100644 --- a/src/utils/stl_util.h +++ b/src/utils/stl_util.h @@ -12,8 +12,12 @@ namespace Botan { -/* +/** * Copy-on-Predicate Algorithm +* @param current the first iterator value +* @param end the final iterator value +* @param dest an output iterator +* @param copy_p the predicate */ template<typename InputIterator, typename OutputIterator, typename Predicate> OutputIterator copy_if(InputIterator current, InputIterator end, @@ -28,8 +32,12 @@ OutputIterator copy_if(InputIterator current, InputIterator end, return dest; } -/* +/** * Searching through a std::map +* @param mapping the map to search +* @param key is what to look for +* @param null_result is the value to return if key is not in mapping +* @return mapping[key] or null_result */ template<typename K, typename V> inline V search_map(const std::map<K, V>& mapping, @@ -42,16 +50,6 @@ inline V search_map(const std::map<K, V>& mapping, return i->second; } -template<typename K, typename V, typename R> -inline R search_map(const std::map<K, V>& mapping, const K& key, - const R& null_result, const R& found_result) - { - typename std::map<K, V>::const_iterator i = mapping.find(key); - if(i == mapping.end()) - return null_result; - return found_result; - } - /** * Function adaptor for delete operation */ |