/usr/include/loki/yasli/yasli_fill_iterator.h is in libloki-dev 0.1.7-3ubuntu1.
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | #ifndef YASLI_FILL_ITERATOR_H_
#define YASLI_FILL_ITERATOR_H_
// $Id: yasli_fill_iterator.h 754 2006-10-17 19:59:11Z syntheticpp $
#include <iterator>
#include <cstddef>
namespace yasli_nstd
{
template <class T>
class fill_iterator_base
: public std::iterator<
std::random_access_iterator_tag,
T,
ptrdiff_t,
T*,
T&>
{
};
template <class T>
class fill_iterator_base<T&>
: public std::iterator<
std::random_access_iterator_tag,
T,
ptrdiff_t,
T*,
T&>
{
};
template <class T>
class fill_iterator : public fill_iterator_base<T>
{
T value_;
/*difference_type*/ ptrdiff_t count_;//////////////////////////////////
public:
typedef std::ptrdiff_t difference_type;
typedef typename fill_iterator_base<T>::pointer pointer;
typedef typename fill_iterator_base<T>::reference reference;
//typedef iterator_type;
fill_iterator()
{
}
explicit fill_iterator(reference value, difference_type count = 0)
: value_(value), count_(count)
{
}
template<class U>
fill_iterator(const fill_iterator<U>& rhs)
: value_(rhs.value_), count_(rhs.count_)
{
}
reference operator*() const
{
return value_;
}
pointer operator->() const
{
return &**this;
}
fill_iterator& operator++()
{
++count_;
return *this;
}
fill_iterator operator++(int)
{
fill_iterator it(*this);
++*this;
return it;
}
fill_iterator& operator--()
{
--count_;
return *this;
}
fill_iterator operator--(int)
{
fill_iterator it(*this);
--*this;
return it;
}
fill_iterator& operator+=(difference_type d)
{
count_ += d;
return *this;
}
fill_iterator operator+(difference_type d) const
{
return fill_iterator(*this) += d;
}
fill_iterator& operator-=(difference_type d)
{
count_ -= d;
return *this;
}
fill_iterator operator-(difference_type d) const
{
return fill_iterator(*this) -= d;
}
difference_type operator-(const fill_iterator<T>& rhs) const
{
return count_ - rhs.count_;
}
reference operator[](difference_type) const
{
return **this;
}
template <class T2>
bool operator==(const fill_iterator<T2>& rhs) const
{
return count_ == rhs.count_;
}
};
template <class T, class D>
inline fill_iterator<T> operator+(D lhs, const fill_iterator<T>& rhs)
{
return rhs + lhs;
}
template <class T>
inline bool operator!=(
const fill_iterator<T>& lhs,
const fill_iterator<T>& rhs)
{ // test for fill_iterator inequality
return !(lhs == rhs);
}
template <class T>
inline bool operator<(
const fill_iterator<T>& lhs,
const fill_iterator<T>& rhs)
{
return lhs.count_ < rhs.count_;
}
template <class T>
inline bool operator>(
const fill_iterator<T>& lhs,
const fill_iterator<T>& rhs)
{
return rhs < lhs;
}
template <class T>
inline bool operator<=(
const fill_iterator<T>& lhs,
const fill_iterator<T>& rhs)
{
return !(rhs < lhs);
}
template <class T>
inline bool operator>=(
const fill_iterator<T>& lhs,
const fill_iterator<T>& rhs)
{
return !(lhs < rhs);
}
} // namespace yasli_nstd
#endif
|