/usr/include/bobcat/ptriter is in libbobcat-dev 4.01.03-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | #ifndef INCLUDED_BOBCAT_PTRITER_
#define INCLUDED_BOBCAT_PTRITER_
#include <iterator>
namespace FBB
{
template <typename Iterator>
class PtrIter: public std::iterator<std::input_iterator_tag,
decltype(&*Iterator())>
{
Iterator d_iter;
public:
typedef decltype(&*Iterator()) PtrType;
PtrIter(Iterator const &iter); // 1.f
PtrIter(PtrIter &&tmp) = default;
PtrIter(PtrIter const &other) = default;
PtrType operator*() const; // opstar.f
PtrIter &operator++(); // opinc.f
bool operator==(PtrIter const &other) const; // opeq.f
bool operator!=(PtrIter const &other) const; // opneq.f
};
template <typename Iterator>
PtrIter<Iterator>::PtrIter(Iterator const &iter)
:
d_iter(iter)
{}
template <typename Iterator>
bool PtrIter<Iterator>::operator==(PtrIter const &other) const
{
return d_iter == other.d_iter;
}
template <typename Iterator>
PtrIter<Iterator> &PtrIter<Iterator>::operator++()
{
++d_iter;
return *this;
}
template <typename Iterator>
bool PtrIter<Iterator>::operator!=(PtrIter const &other) const
{
return d_iter != other.d_iter;
}
template <typename Iterator>
typename PtrIter<Iterator>::PtrType PtrIter<Iterator>::operator*() const
{
return &*d_iter;
}
// Free functions
template<typename Iterator>
PtrIter<Iterator> ptrIter(Iterator const &iter)
{
return PtrIter<Iterator>(iter);
}
} // FBB
#endif
|