]> git.sesse.net Git - casparcg/blob - dependencies/boost/boost/bimap/support/iterator_type_by.hpp
Manually merged pull request #222
[casparcg] / dependencies / boost / boost / bimap / support / iterator_type_by.hpp
1 // Boost.Bimap
2 //
3 // Copyright (c) 2006-2007 Matias Capeletto
4 //
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8
9 /// \file support/iterator_type_by.hpp
10 /// \brief Metafunctions to access the iterator types of a bimap
11
12 #ifndef BOOST_BIMAP_SUPPORT_ITERATOR_TYPE_BY_HPP
13 #define BOOST_BIMAP_SUPPORT_ITERATOR_TYPE_BY_HPP
14
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
16 #pragma once
17 #endif
18
19 #include <boost/config.hpp>
20
21 #include <boost/bimap/relation/detail/metadata_access_builder.hpp>
22 #include <boost/bimap/relation/detail/static_access_builder.hpp>
23
24 #include <boost/bimap/relation/support/pair_type_by.hpp>
25
26 #include <boost/bimap/detail/map_view_iterator.hpp>
27
28 /** \struct boost::bimaps::support::iterator_type_by
29
30 \brief Metafunction to obtain the iterator type of the map view by one of the sides.
31
32 \code
33
34 template< class Tag, class Bimap >
35 struct iterator_type_by
36 {
37     typedef -unspecified- type;
38 };
39
40 template< class Tag, class Bimap >
41 struct const_iterator_type_by
42 {
43     typedef -unspecified- type;
44 };
45
46 template< class Tag, class Bimap >
47 struct reverse_iterator_type_by
48 {
49     typedef -unspecified- type;
50 };
51
52 template< class Tag, class Bimap >
53 struct const_reverse_iterator_type_by
54 {
55     typedef -unspecified- type;
56 };
57
58 template< class Tag, class Bimap >
59 struct local_iterator_type_by
60 {
61     typedef -unspecified- type;
62 };
63
64 template< class Tag, class Bimap >
65 struct const_local_iterator_type_by
66 {
67     typedef -unspecified- type;
68 };
69
70 \endcode
71
72 See also member_at.
73 \ingroup bimap_group
74                                                                     **/
75
76 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
77
78 namespace boost {
79 namespace bimaps {
80 namespace support {
81
82
83 // Implementation of iterator type by metafunction
84
85 BOOST_BIMAP_SYMMETRIC_METADATA_ACCESS_BUILDER
86 (
87     iterator_type_by,
88     left_iterator,
89     right_iterator
90 )
91
92 // Implementation of const iterator type by metafunction
93
94 BOOST_BIMAP_SYMMETRIC_METADATA_ACCESS_BUILDER
95 (
96     const_iterator_type_by,
97     left_const_iterator,
98     right_const_iterator
99 )
100
101
102 // Implementation of reverse iterator type by metafunction
103
104 BOOST_BIMAP_SYMMETRIC_STATIC_ACCESS_BUILDER
105 (
106     core_reverse_iterator_type_by,
107     BimapCore,
108
109     typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
110         index<BOOST_DEDUCED_TYPENAME BimapCore::left_tag>
111             ::type::reverse_iterator type,
112
113     typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
114         index<BOOST_DEDUCED_TYPENAME BimapCore::right_tag>
115             ::type::reverse_iterator type
116 )
117
118 template< class Tag, class BimapCore >
119 struct reverse_iterator_type_by
120 {
121     typedef ::boost::bimaps::detail::map_view_iterator
122     <
123         Tag,
124         BOOST_DEDUCED_TYPENAME BimapCore::relation,
125         BOOST_DEDUCED_TYPENAME core_reverse_iterator_type_by<Tag,BimapCore>::type
126
127     > type;
128 };
129
130 // Implementation of const reverse iterator type by metafunction
131
132 BOOST_BIMAP_SYMMETRIC_STATIC_ACCESS_BUILDER
133 (
134     core_const_reverse_iterator_type_by,
135     BimapCore,
136
137     typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
138         index<BOOST_DEDUCED_TYPENAME BimapCore::left_tag>
139             ::type::const_reverse_iterator type,
140
141     typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
142         index<BOOST_DEDUCED_TYPENAME BimapCore::right_tag>
143             ::type::const_reverse_iterator type
144 )
145
146 template< class Tag, class BimapCore >
147 struct const_reverse_iterator_type_by
148 {
149
150     typedef ::boost::bimaps::detail::map_view_iterator
151     <
152         Tag,
153         BOOST_DEDUCED_TYPENAME BimapCore::relation,
154         BOOST_DEDUCED_TYPENAME core_const_reverse_iterator_type_by<Tag,BimapCore>::type
155
156     > type;
157 };
158
159
160 // Implementation of local iterator type by metafunction
161
162 BOOST_BIMAP_SYMMETRIC_STATIC_ACCESS_BUILDER
163 (
164     core_local_iterator_type_by,
165     BimapCore,
166
167     typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
168         index<BOOST_DEDUCED_TYPENAME BimapCore::left_tag>
169             ::type::local_iterator type,
170
171     typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
172         index<BOOST_DEDUCED_TYPENAME BimapCore::right_tag>
173             ::type::local_iterator type
174 )
175
176
177 template< class Tag, class BimapCore >
178 struct local_iterator_type_by
179 {
180
181     typedef ::boost::bimaps::detail::map_view_iterator
182     <
183         Tag,
184         BOOST_DEDUCED_TYPENAME BimapCore::relation,
185         BOOST_DEDUCED_TYPENAME core_local_iterator_type_by<Tag,BimapCore>::type
186
187     > type;
188 };
189
190
191 // Implementation of const local iterator type by metafunction
192
193 BOOST_BIMAP_SYMMETRIC_STATIC_ACCESS_BUILDER
194 (
195     core_const_local_iterator_type_by,
196     BimapCore,
197
198     typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
199         index<BOOST_DEDUCED_TYPENAME BimapCore::left_tag>
200             ::type::const_local_iterator type,
201
202     typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
203         index<BOOST_DEDUCED_TYPENAME BimapCore::right_tag>
204             ::type::const_local_iterator type
205 )
206
207 template< class Tag, class BimapCore >
208 struct const_local_iterator_type_by
209 {
210
211     typedef ::boost::bimaps::detail::map_view_iterator
212     <
213         Tag,
214         BOOST_DEDUCED_TYPENAME BimapCore::relation,
215         BOOST_DEDUCED_TYPENAME core_const_local_iterator_type_by<Tag,BimapCore>::type
216
217     > type;
218 };
219
220
221 } // namespace support
222 } // namespace bimaps
223 } // namespace boost
224
225 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
226
227 #endif // BOOST_BIMAP_SUPPORT_ITERATOR_TYPE_BY_HPP
228