PageRenderTime 20ms CodeModel.GetById 9ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

/Src/Dependencies/Boost/libs/iterator/test/iterator_archetype_cc.cpp

http://hadesmem.googlecode.com/
C++ | 61 lines | 48 code | 7 blank | 6 comment | 0 complexity | 0b9b736a08d21ed5466386fecf2c58d6 MD5 | raw file
 1//
 2// Copyright Thomas Witt 2003.
 3// Distributed under the Boost Software License, Version 1.0. (See
 4// accompanying file LICENSE_1_0.txt or copy at
 5// http://www.boost.org/LICENSE_1_0.txt)
 6//
 7#include <boost/iterator/iterator_archetypes.hpp>
 8#include <boost/iterator/iterator_categories.hpp>
 9#include <boost/iterator/iterator_concepts.hpp>
10#include <boost/concept_check.hpp>
11#include <boost/cstdlib.hpp>
12
13int main()
14{
15  {
16    typedef boost::iterator_archetype<
17        int
18      , boost::iterator_archetypes::readable_iterator_t
19      , boost::random_access_traversal_tag
20    > iter;
21
22    boost::function_requires< boost_concepts::ReadableIteratorConcept<iter> >();
23    boost::function_requires< boost_concepts::RandomAccessTraversalConcept<iter> >();
24  } 
25  {
26    typedef boost::iterator_archetype<
27        int
28      , boost::iterator_archetypes::readable_writable_iterator_t
29      , boost::random_access_traversal_tag
30    > iter;
31
32    boost::function_requires< boost_concepts::ReadableIteratorConcept<iter> >();
33    boost::function_requires< boost_concepts::WritableIteratorConcept<iter> >();
34    boost::function_requires< boost_concepts::RandomAccessTraversalConcept<iter> >();
35  } 
36  {
37    typedef boost::iterator_archetype<
38        const int // I don't like adding const to Value. It is redundant. -JGS
39      , boost::iterator_archetypes::readable_lvalue_iterator_t
40      , boost::random_access_traversal_tag
41    > iter;
42
43    boost::function_requires< boost_concepts::ReadableIteratorConcept<iter> >();
44    boost::function_requires< boost_concepts::LvalueIteratorConcept<iter> >();
45    boost::function_requires< boost_concepts::RandomAccessTraversalConcept<iter> >();
46  } 
47  {
48    typedef boost::iterator_archetype<
49        int
50      , boost::iterator_archetypes::writable_lvalue_iterator_t
51      , boost::random_access_traversal_tag
52    > iter;
53
54    boost::function_requires< boost_concepts::WritableIteratorConcept<iter> >();
55    boost::function_requires< boost_concepts::LvalueIteratorConcept<iter> >();
56    boost::function_requires< boost_concepts::RandomAccessTraversalConcept<iter> >();
57  } 
58
59  return boost::exit_success;
60}
61