00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef BABAR_COMP_INST
00019 #include "BaBar.hh"
00020 #endif // BABAR_COMP_INST
00021
00022 #if defined(__SUNPRO_CC)
00023
00024 #include <stddef.h>
00025
00026 namespace std
00027 {
00028 template <class InputIterator, class T>
00029 ptrdiff_t
00030 count (InputIterator first, InputIterator last, const T& value)
00031 {
00032 ptrdiff_t n = 0;
00033 while (first != last)
00034 if (*first++ == value) ++n;
00035 return n;
00036 }
00037
00038 template <class InputIterator, class Predicate>
00039 ptrdiff_t
00040 count_if (InputIterator first, InputIterator last, Predicate pred)
00041 {
00042 ptrdiff_t n = 0;
00043 while (first != last)
00044 if (pred(*first++)) ++n;
00045 return n;
00046 }
00047
00048 template <class InputIterator>
00049 ptrdiff_t
00050 distance (InputIterator first, InputIterator last)
00051 {
00052 ptrdiff_t n = 0;
00053 while (first != last)
00054 { ++first; ++n; }
00055 return n;
00056 }
00057 }
00058 #endif // __SUNPRO_CC