fix doc example typo
[boost.git] / boost / multi_array / collection_concept.hpp
blobc79ace1bd8ab618ee5927100fe972ab0a5b7671c
1 // Copyright 2002 The Trustees of Indiana University.
3 // Use, modification and distribution is subject to the Boost Software
4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // Boost.MultiArray Library
8 // Authors: Ronald Garcia
9 // Jeremy Siek
10 // Andrew Lumsdaine
11 // See http://www.boost.org/libs/multi_array for documentation.
13 #ifndef COLLECTION_CONCEPT_RG103101_HPP
14 #define COLLECTION_CONCEPT_RG103101_HPP
16 #include "boost/concept_check.hpp"
18 namespace boost {
19 namespace detail {
20 namespace multi_array {
22 //===========================================================================
23 // Collection Concept
25 template <class Collection>
26 struct CollectionConcept
28 typedef typename Collection::value_type value_type;
29 typedef typename Collection::iterator iterator;
30 typedef typename Collection::const_iterator const_iterator;
31 typedef typename Collection::reference reference;
32 typedef typename Collection::const_reference const_reference;
33 // typedef typename Collection::pointer pointer;
34 typedef typename Collection::difference_type difference_type;
35 typedef typename Collection::size_type size_type;
37 void constraints() {
38 boost::function_requires<boost::InputIteratorConcept<iterator> >();
39 boost::function_requires<boost::InputIteratorConcept<const_iterator> >();
40 boost::function_requires<boost::CopyConstructibleConcept<value_type> >();
41 const_constraints(c);
42 i = c.begin();
43 i = c.end();
44 c.swap(c);
46 void const_constraints(const Collection& c) {
47 ci = c.begin();
48 ci = c.end();
49 n = c.size();
50 b = c.empty();
52 Collection c;
53 bool b;
54 iterator i;
55 const_iterator ci;
56 size_type n;
62 #endif // COLLECTION_CONCEPT_RG103101_HPP