wrapped_forward_iterator.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PALUDIS_GUARD_PALUDIS_UTIL_WRAPPED_FORWARD_ITERATOR_HH
00021 #define PALUDIS_GUARD_PALUDIS_UTIL_WRAPPED_FORWARD_ITERATOR_HH 1
00022
00023 #include <paludis/util/wrapped_forward_iterator-fwd.hh>
00024 #include <paludis/util/operators.hh>
00025 #include <paludis/util/attributes.hh>
00026 #include <tr1/functional>
00027 #include <tr1/type_traits>
00028 #include <iterator>
00029
00030 #ifdef PALUDIS_HAVE_CONCEPTS
00031 # include <concepts>
00032 #endif
00033
00034 namespace paludis
00035 {
00036
00037
00038
00039
00040
00041
00042
00043 template <typename Tag_, typename Value_>
00044 class PALUDIS_VISIBLE WrappedForwardIterator :
00045 public equality_operators::HasEqualityOperators
00046 {
00047 private:
00048 struct Base;
00049 template <typename T_> struct BaseImpl;
00050
00051 Base * _base;
00052
00053 public:
00054
00055
00056
00057 WrappedForwardIterator();
00058 ~WrappedForwardIterator();
00059 WrappedForwardIterator(const WrappedForwardIterator &);
00060
00061 template <typename T_>
00062 WrappedForwardIterator(const T_ &);
00063
00064 WrappedForwardIterator & operator= (const WrappedForwardIterator &);
00065
00066
00067
00068
00069
00070
00071 typedef typename std::tr1::remove_reference<Value_>::type & value_type;
00072 typedef typename std::tr1::remove_reference<Value_>::type & reference;
00073 typedef typename std::tr1::remove_reference<Value_>::type * pointer;
00074 typedef std::ptrdiff_t difference_type;
00075 typedef std::forward_iterator_tag iterator_category;
00076
00077
00078
00079
00080
00081
00082 WrappedForwardIterator & operator++ ();
00083 WrappedForwardIterator operator++ (int);
00084
00085
00086
00087
00088
00089
00090 pointer operator-> () const;
00091 reference operator* () const;
00092
00093
00094
00095
00096
00097
00098 bool operator== (const WrappedForwardIterator &) const;
00099
00100
00101
00102
00103
00104
00105 template <typename T_> T_ & underlying_iterator();
00106 template <typename T_> const T_ & underlying_iterator() const;
00107
00108
00109 };
00110 }
00111
00112 #ifdef PALUDIS_HAVE_CONCEPTS
00113 namespace std
00114 {
00115 template <typename Tag_, typename Value_>
00116 concept_map ForwardIterator<paludis::WrappedForwardIterator<Tag_, Value_> >
00117 {
00118 };
00119 }
00120 #endif
00121
00122 #endif