]> git.lyx.org Git - lyx.git/blob - boost/boost/multi_array/collection_concept.hpp
2002-05-24 Lars Gullik Bj�nnes <larsbj@birdstep.com>
[lyx.git] / boost / boost / multi_array / collection_concept.hpp
1 #ifndef COLLECTION_CONCEPT_RG103101_HPP
2 #define COLLECTION_CONCEPT_RG103101_HPP
3
4 #include "boost/concept_check.hpp"
5
6 namespace boost {
7 namespace detail {
8 namespace multi_array {
9
10   //===========================================================================
11   // Collection Concept
12
13   template <class Collection>
14   struct CollectionConcept
15   {
16     typedef typename Collection::value_type value_type;
17     typedef typename Collection::iterator iterator;
18     typedef typename Collection::const_iterator const_iterator;
19     typedef typename Collection::reference reference;
20     typedef typename Collection::const_reference const_reference;
21     // typedef typename Collection::pointer pointer;
22     typedef typename Collection::difference_type difference_type;
23     typedef typename Collection::size_type size_type;
24
25     void constraints() {
26       boost::function_requires<boost::InputIteratorConcept<iterator> >();
27       boost::function_requires<boost::InputIteratorConcept<const_iterator> >();
28       boost::function_requires<boost::CopyConstructibleConcept<value_type> >();
29       const_constraints(c);
30       i = c.begin();
31       i = c.end();
32       c.swap(c);
33     }
34     void const_constraints(const Collection& c) {
35       ci = c.begin();
36       ci = c.end();
37       n = c.size();
38       b = c.empty();
39     }
40     Collection c;
41     bool b;
42     iterator i;
43     const_iterator ci;
44     size_type n;
45   };
46
47 }
48 }
49 }
50 #endif // COLLECTION_CONCEPT_RG103101_HPP