4bde159df07f604005ab54a2492f5fefefe6e379
[senf.git] / boost / bimap / container_adaptor / support / iterator_facade_converters.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 container_adaptor/support/iterator_facade_converters.hpp
10 /// \brief Converter for Boost.Iterators based iterators.
11
12 #ifndef BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_ITERATOR_FACADE_CONVERTERS_HPP
13 #define BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_ITERATOR_FACADE_CONVERTERS_HPP
14
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
16 #pragma once
17 #endif
18
19 #include <boost/config.hpp>
20
21 namespace boost {
22 namespace bimaps {
23 namespace container_adaptor {
24
25 /// \brief Utilities to help in the construction of a container adaptor
26
27 namespace support {
28
29 /// \brief Converter for Boost.Iterators based iterators.
30 /**
31 Container adaptor is dessigned to play well with Boost.Iterators. This
32 converter can be used if this library is used to adapt the iterators.
33                                                                             **/
34 template
35 <
36     class Iterator,
37     class ConstIterator
38 >
39 struct iterator_facade_to_base
40 {
41     BOOST_DEDUCED_TYPENAME Iterator::base_type operator()(Iterator iter) const
42     {
43         return iter.base();
44     }
45
46     BOOST_DEDUCED_TYPENAME ConstIterator::base_type operator()(ConstIterator iter) const
47     {
48         return iter.base();
49     }
50 };
51
52 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
53
54 template
55 <
56     class Iterator
57 >
58 struct iterator_facade_to_base<Iterator,Iterator>
59 {
60     BOOST_DEDUCED_TYPENAME Iterator::base_type operator()(Iterator iter) const
61     {
62         return iter.base();
63     }
64 };
65
66 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
67
68 #undef BOOST_BIMAP_CONTAINER_ADAPTOR_IMPLEMENT_CONVERT_FACADE_FUNCTION
69
70
71 } // namespace support
72 } // namespace container_adaptor
73 } // namespace bimaps
74 } // namespace boost
75
76
77 #endif // BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_ITERATOR_FACADE_CONVERTERS_HPP