| 1 | #include <iostream>
|
|---|
| 2 | #include <iterator>
|
|---|
| 3 | #include <utility>
|
|---|
| 4 |
|
|---|
| 5 | #include <boost/cstdlib.hpp>
|
|---|
| 6 |
|
|---|
| 7 | #include <boost/type_traits/is_base_and_derived.hpp>
|
|---|
| 8 |
|
|---|
| 9 | #include <boost/concept/requires.hpp>
|
|---|
| 10 | #include <boost/concept_check.hpp>
|
|---|
| 11 |
|
|---|
| 12 | #include <boost/iterator/iterator_categories.hpp>
|
|---|
| 13 |
|
|---|
| 14 | #define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 1
|
|---|
| 15 | #include <boost/range/concepts.hpp>
|
|---|
| 16 |
|
|---|
| 17 | typedef int ValueType;
|
|---|
| 18 |
|
|---|
| 19 | template <typename T = ValueType>
|
|---|
| 20 | struct Iterator : std::iterator<std::bidirectional_iterator_tag, T>
|
|---|
| 21 | {
|
|---|
| 22 | typedef std::iterator<std::bidirectional_iterator_tag, T> base;
|
|---|
| 23 |
|
|---|
| 24 | typedef typename std::iterator_traits<base>::value_type value_type;
|
|---|
| 25 | typedef typename std::iterator_traits<base>::difference_type difference_type;
|
|---|
| 26 | typedef typename std::iterator_traits<base>::reference reference;
|
|---|
| 27 | typedef typename std::iterator_traits<base>::pointer pointer;
|
|---|
| 28 | typedef typename std::iterator_traits<base>::iterator_category iterator_category;
|
|---|
| 29 |
|
|---|
| 30 | Iterator(const Iterator&);
|
|---|
| 31 | Iterator* operator&(void);
|
|---|
| 32 | const Iterator* operator&(void) const;
|
|---|
| 33 | Iterator& operator++(void);
|
|---|
| 34 | Iterator operator++(int);
|
|---|
| 35 | bool operator==(const Iterator&) const;
|
|---|
| 36 | bool operator!=(const Iterator&) const;
|
|---|
| 37 | Iterator();
|
|---|
| 38 | Iterator& operator--(void);
|
|---|
| 39 | Iterator operator--(int);
|
|---|
| 40 | };
|
|---|
| 41 |
|
|---|
| 42 | struct Container
|
|---|
| 43 | {
|
|---|
| 44 | typedef Iterator<ValueType> iterator;
|
|---|
| 45 | typedef Iterator<const ValueType> const_iterator;
|
|---|
| 46 | iterator begin(void);
|
|---|
| 47 | const_iterator begin(void) const;
|
|---|
| 48 | iterator end(void);
|
|---|
| 49 | const_iterator end(void) const;
|
|---|
| 50 | };
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 | template <typename T>
|
|---|
| 54 | BOOST_CONCEPT_REQUIRES
|
|---|
| 55 | (
|
|---|
| 56 | ((boost::BidirectionalRangeConcept<Container>))
|
|---|
| 57 | ((boost::BidirectionalRangeConcept<std::pair<Iterator<>, Iterator<> > >))
|
|---|
| 58 | ((boost::BidirectionalRangeConcept<ValueType[68]>))
|
|---|
| 59 | , (void)
|
|---|
| 60 | )
|
|---|
| 61 | check(...)
|
|---|
| 62 | {}
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 | int main(void)
|
|---|
| 66 | {
|
|---|
| 67 | return boost::exit_success;
|
|---|
| 68 | }
|
|---|