diff options
| author | Howard Hinnant <hhinnant@apple.com> | 2010-08-14 18:14:02 +0000 |
|---|---|---|
| committer | Howard Hinnant <hhinnant@apple.com> | 2010-08-14 18:14:02 +0000 |
| commit | 48b242a275266e27eabf64915e4512f0aa592f00 (patch) | |
| tree | f7854fd9bfe7b610ef0fce50ef36d0fe395e7b54 /libcxx/test/re/iterators.h | |
| parent | 2f6c3434ac57ed909522583752f7f5b02bb03c87 (diff) | |
| download | bcm5719-llvm-48b242a275266e27eabf64915e4512f0aa592f00.tar.gz bcm5719-llvm-48b242a275266e27eabf64915e4512f0aa592f00.zip | |
Everything under [re.results]
llvm-svn: 111074
Diffstat (limited to 'libcxx/test/re/iterators.h')
| -rw-r--r-- | libcxx/test/re/iterators.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libcxx/test/re/iterators.h b/libcxx/test/re/iterators.h index 85332ac725d..8ca5e889ec8 100644 --- a/libcxx/test/re/iterators.h +++ b/libcxx/test/re/iterators.h @@ -4,6 +4,32 @@ #include <iterator> template <class It> +class output_iterator +{ + It it_; + + template <class U> friend class output_iterator; +public: + typedef std::output_iterator_tag iterator_category; + typedef typename std::iterator_traits<It>::value_type value_type; + typedef typename std::iterator_traits<It>::difference_type difference_type; + typedef It pointer; + typedef typename std::iterator_traits<It>::reference reference; + + It base() const {return it_;} + + explicit output_iterator(It it) : it_(it) {} + template <class U> + output_iterator(const output_iterator<U>& u) :it_(u.it_) {} + + reference operator*() const {return *it_;} + + output_iterator& operator++() {++it_; return *this;} + output_iterator operator++(int) + {output_iterator tmp(*this); ++(*this); return tmp;} +}; + +template <class It> class input_iterator { It it_; |

