1 // (C) Copyright Jeremy Siek 2001.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #include <boost/property_map/property_map.hpp>
7 #include <boost/property_map/shared_array_property_map.hpp>
10 // This file checks the property map concepts against the property map
11 // archetypes to make sure they are consistent and that they compile.
12 // This also checks all the property map classes defined in
13 // property_map.hpp against the concept checking classes.
18 using namespace boost
;
20 typedef null_archetype
<> Key
;
21 typedef assignable_archetype
<copy_constructible_archetype
<> > Value
;
22 typedef readable_property_map_archetype
<Key
, Value
> PMap
;
23 BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept
<PMap
, Key
>));
26 typedef null_archetype
<> Key
;
27 typedef assignable_archetype
<copy_constructible_archetype
<> > Value
;
28 typedef writable_property_map_archetype
<Key
, Value
> PMap
;
29 BOOST_CONCEPT_ASSERT((WritablePropertyMapConcept
<PMap
, Key
>));
32 typedef null_archetype
<> Key
;
33 typedef assignable_archetype
<copy_constructible_archetype
<> > Value
;
34 typedef read_write_property_map_archetype
<Key
, Value
> PMap
;
35 BOOST_CONCEPT_ASSERT((ReadWritePropertyMapConcept
<PMap
, Key
>));
38 typedef null_archetype
<> Key
;
39 typedef assignable_archetype
<copy_constructible_archetype
<> > Value
;
40 typedef lvalue_property_map_archetype
<Key
, Value
> PMap
;
41 BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept
<PMap
, Key
>));
44 typedef null_archetype
<> Key
;
45 typedef assignable_archetype
<copy_constructible_archetype
<> > Value
;
46 typedef mutable_lvalue_property_map_archetype
<Key
, Value
> PMap
;
47 BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept
<PMap
, Key
>));
50 typedef std::ptrdiff_t Key
;
52 BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept
<PMap
, Key
>));
55 typedef std::ptrdiff_t Key
;
56 typedef const int* PMap
;
57 BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept
<PMap
, Key
>));
60 typedef sgi_assignable_archetype
<> Key
; // ?
61 typedef sgi_assignable_archetype
<> Value
;
62 typedef random_access_iterator_archetype
<Value
> Iterator
;
63 typedef readable_property_map_archetype
<Key
, std::ptrdiff_t> IndexMap
;
64 typedef iterator_property_map
<Iterator
, IndexMap
65 #ifdef BOOST_NO_STD_ITERATOR_TRAITS
69 BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept
<PMap
, Key
>));
72 typedef sgi_assignable_archetype
<> Key
;
73 typedef sgi_assignable_archetype
<> Value
;
74 typedef mutable_random_access_iterator_archetype
<Value
> Iterator
;
75 typedef readable_property_map_archetype
<Key
, std::ptrdiff_t> IndexMap
;
76 typedef iterator_property_map
<Iterator
, IndexMap
77 #ifdef BOOST_NO_STD_ITERATOR_TRAITS
81 BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept
<PMap
, Key
>));
84 typedef sgi_assignable_archetype
< less_than_comparable_archetype
<> > Key
;
85 typedef default_constructible_archetype
< sgi_assignable_archetype
<> >
87 typedef std::map
<Key
, Value
> Container
;
88 typedef associative_property_map
<Container
> PMap
;
89 BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept
<PMap
, Key
>));
92 typedef sgi_assignable_archetype
< less_than_comparable_archetype
<> > Key
;
93 typedef default_constructible_archetype
< sgi_assignable_archetype
<> >
95 typedef std::map
<Key
, Value
> Container
;
96 typedef const_associative_property_map
<Container
> PMap
;
97 BOOST_CONCEPT_ASSERT((LvaluePropertyMapConcept
<PMap
, Key
>));
100 typedef identity_property_map PMap
;
101 BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept
<PMap
, int>));
104 typedef dummy_property_map PMap
;
105 BOOST_CONCEPT_ASSERT((ReadWritePropertyMapConcept
<PMap
, int>));
108 typedef sgi_assignable_archetype
<> Key
; // ?
109 typedef sgi_assignable_archetype
<> Value
;
110 typedef readable_property_map_archetype
<Key
, std::ptrdiff_t> IndexMap
;
111 typedef shared_array_property_map
<Value
, IndexMap
> PMap
;
112 BOOST_CONCEPT_ASSERT((Mutable_LvaluePropertyMapConcept
<PMap
, Key
>));