diff options
author | lloyd <[email protected]> | 2009-03-30 18:27:18 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-03-30 18:27:18 +0000 |
commit | 96d6eb6f29c55e16a37cf11899547886f735b065 (patch) | |
tree | 9f13901e9b44c98d58b2589c9b09c6a7443eb7cd /src/utils/stl_util.h | |
parent | 3cc3dd72c5f87b76852a55c1f2d1821dba967d8c (diff) |
Thomas Moschny passed along a request from the Fedora packagers which came
up during the Fedora submission review, that each source file include some
text about the license. One handy Perl script later and each file now has
the line
Distributed under the terms of the Botan license
after the copyright notices.
While I was in there modifying every file anyway, I also stripped out the
remainder of the block comments (lots of astericks before and after the
text); this is stylistic thing I picked up when I was first learning C++
but in retrospect it is not a good style as the structure makes it harder
to modify comments (with the result that comments become fewer, shorter and
are less likely to be updated, which are not good things).
Diffstat (limited to 'src/utils/stl_util.h')
-rw-r--r-- | src/utils/stl_util.h | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/utils/stl_util.h b/src/utils/stl_util.h index 95a19581f..18c8b149b 100644 --- a/src/utils/stl_util.h +++ b/src/utils/stl_util.h @@ -1,7 +1,9 @@ -/************************************************* -* STL Utility Functions Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* STL Utility Functions +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_STL_UTIL_H__ #define BOTAN_STL_UTIL_H__ @@ -10,9 +12,9 @@ namespace Botan { -/************************************************* -* Copy-on-Predicate Algorithm * -*************************************************/ +/* +* Copy-on-Predicate Algorithm +*/ template<typename InputIterator, typename OutputIterator, typename Predicate> OutputIterator copy_if(InputIterator current, InputIterator end, OutputIterator dest, Predicate copy_p) @@ -26,9 +28,9 @@ OutputIterator copy_if(InputIterator current, InputIterator end, return dest; } -/************************************************* -* Searching through a std::map * -*************************************************/ +/* +* Searching through a std::map +*/ template<typename K, typename V> inline V search_map(const std::map<K, V>& mapping, const K& key, @@ -50,9 +52,9 @@ inline R search_map(const std::map<K, V>& mapping, const K& key, return found_result; } -/************************************************* -* Function adaptor for delete operation * -*************************************************/ +/* +* Function adaptor for delete operation +*/ template<class T> class del_fun : public std::unary_function<T, void> { @@ -60,18 +62,18 @@ class del_fun : public std::unary_function<T, void> void operator()(T* ptr) { delete ptr; } }; -/************************************************* -* Delete the second half of a pair of objects * -*************************************************/ +/* +* Delete the second half of a pair of objects +*/ template<typename Pair> void delete2nd(Pair& pair) { delete pair.second; } -/************************************************* -* Insert a key/value pair into a multimap * -*************************************************/ +/* +* Insert a key/value pair into a multimap +*/ template<typename K, typename V> void multimap_insert(std::multimap<K, V>& multimap, const K& key, const V& value) |