Added changing of the file priorities.

Seperated the algorithm extensions from functional.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@326 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-03-05 20:56:12 +00:00
parent 2dc7ffdb8f
commit ddf619f934
17 changed files with 105 additions and 40 deletions
+1
View File
@@ -1,6 +1,7 @@
noinst_LIBRARIES = libsub_utils.a
libsub_utils_a_SOURCES = \
algorithm.h \
directory.cc \
directory.h \
functional.h \
+23
View File
@@ -0,0 +1,23 @@
#ifndef RTORRENT_UTILS_ALGORITHM_H
#define RTORRENT_UTILS_ALGORITHM_H
#include <algorithm>
namespace utils {
template <typename _InputIter, typename _Function>
_Function for_each_pre(_InputIter __first, _InputIter __last, _Function __f) {
_InputIter __tmp;
while (__first != __last) {
__tmp = first++;
__f(*__tmp);
}
return __f;
}
}
#endif
+3 -14
View File
@@ -1,20 +1,9 @@
#ifndef RTORRENT_FUNCTIONAL_H
#define RTORRENT_FUNCTIONAL_H
#ifndef RTORRENT_UTILS_FUNCTIONAL_H
#define RTORRENT_UTILS_FUNCTIONAL_H
#include <functional>
namespace func {
template <typename Iterator, typename Ftor>
inline void for_each(Iterator first, Iterator last, Ftor ftor) {
Iterator tmp;
while (first != last) {
tmp = first++;
ftor(*tmp);
}
}
namespace utils {
template <typename Type, typename Ftor>
struct _accumulate {