#ifndef SOURCE_OPT_ITERATOR_H_
#define SOURCE_OPT_ITERATOR_H_
#include <cstddef>
#include <iterator>
#include <memory>
#include <type_traits>
#include <utility>
#include <vector>
namespace spvtools {
namespace opt {
template <typename ValueType, bool IsConst = false>
class UptrVectorIterator { … };
template <typename IteratorType>
class IteratorRange { … };
template <typename IteratorType>
inline IteratorRange<IteratorType> make_range(const IteratorType& begin,
const IteratorType& end) { … }
template <typename IteratorType>
inline IteratorRange<IteratorType> make_range(IteratorType&& begin,
IteratorType&& end) { … }
template <typename ValueType,
class IteratorType = UptrVectorIterator<ValueType>>
inline IteratorRange<IteratorType> make_range(
std::vector<std::unique_ptr<ValueType>>& container) { … }
template <typename ValueType,
class IteratorType = UptrVectorIterator<ValueType, true>>
inline IteratorRange<IteratorType> make_const_range(
const std::vector<std::unique_ptr<ValueType>>& container) { … }
template <typename SubIterator, typename Predicate>
class FilterIterator { … };
template <typename SubIterator, typename Predicate>
FilterIterator<SubIterator, Predicate> MakeFilterIterator(
const IteratorRange<SubIterator>& sub_iterator_range, Predicate predicate) { … }
template <typename SubIterator, typename Predicate>
FilterIterator<SubIterator, Predicate> MakeFilterIterator(
const SubIterator& begin, const SubIterator& end, Predicate predicate) { … }
template <typename SubIterator, typename Predicate>
typename FilterIterator<SubIterator, Predicate>::Range MakeFilterIteratorRange(
const SubIterator& begin, const SubIterator& end, Predicate predicate) { … }
template <typename VT, bool IC>
inline UptrVectorIterator<VT, IC>& UptrVectorIterator<VT, IC>::operator++() { … }
template <typename VT, bool IC>
inline UptrVectorIterator<VT, IC> UptrVectorIterator<VT, IC>::operator++(int) { … }
template <typename VT, bool IC>
inline UptrVectorIterator<VT, IC>& UptrVectorIterator<VT, IC>::operator--() { … }
template <typename VT, bool IC>
inline UptrVectorIterator<VT, IC> UptrVectorIterator<VT, IC>::operator--(int) { … }
template <typename VT, bool IC>
inline bool UptrVectorIterator<VT, IC>::operator==(
const UptrVectorIterator& that) const { … }
template <typename VT, bool IC>
inline bool UptrVectorIterator<VT, IC>::operator!=(
const UptrVectorIterator& that) const { … }
template <typename VT, bool IC>
inline ptrdiff_t UptrVectorIterator<VT, IC>::operator-(
const UptrVectorIterator& that) const { … }
template <typename VT, bool IC>
inline bool UptrVectorIterator<VT, IC>::operator<(
const UptrVectorIterator& that) const { … }
template <typename VT, bool IC>
template <bool IsConstForMethod>
inline
typename std::enable_if<!IsConstForMethod, UptrVectorIterator<VT, IC>>::type
UptrVectorIterator<VT, IC>::InsertBefore(Uptr value) { … }
template <typename VT, bool IC>
template <bool IsConstForMethod>
inline
typename std::enable_if<!IsConstForMethod, UptrVectorIterator<VT, IC>>::type
UptrVectorIterator<VT, IC>::InsertBefore(UptrVector* values) { … }
template <typename VT, bool IC>
template <bool IsConstForMethod>
inline
typename std::enable_if<!IsConstForMethod, UptrVectorIterator<VT, IC>>::type
UptrVectorIterator<VT, IC>::Erase() { … }
}
}
#endif