]>
Commit | Line | Data |
---|---|---|
20effc67 | 1 | /* Copyright 2003-2020 Joaquin M Lopez Munoz. |
7c673cae FG |
2 | * Distributed under the Boost Software License, Version 1.0. |
3 | * (See accompanying file LICENSE_1_0.txt or copy at | |
4 | * http://www.boost.org/LICENSE_1_0.txt) | |
5 | * | |
6 | * See http://www.boost.org/libs/multi_index for library home page. | |
7 | */ | |
8 | ||
9 | #ifndef BOOST_MULTI_INDEX_DETAIL_CONVERTER_HPP | |
10 | #define BOOST_MULTI_INDEX_DETAIL_CONVERTER_HPP | |
11 | ||
12 | #if defined(_MSC_VER) | |
13 | #pragma once | |
14 | #endif | |
15 | ||
16 | namespace boost{ | |
17 | ||
18 | namespace multi_index{ | |
19 | ||
20 | namespace detail{ | |
21 | ||
22 | /* converter offers means to access indices of a given multi_index_container | |
23 | * and for convertibilty between index iterators, so providing a | |
24 | * localized access point for get() and project() functions. | |
25 | */ | |
26 | ||
27 | template<typename MultiIndexContainer,typename Index> | |
28 | struct converter | |
29 | { | |
30 | static const Index& index(const MultiIndexContainer& x){return x;} | |
31 | static Index& index(MultiIndexContainer& x){return x;} | |
32 | ||
33 | static typename Index::const_iterator const_iterator( | |
20effc67 TL |
34 | const MultiIndexContainer& x, |
35 | typename MultiIndexContainer::final_node_type* node) | |
7c673cae FG |
36 | { |
37 | return x.Index::make_iterator(node); | |
38 | } | |
39 | ||
40 | static typename Index::iterator iterator( | |
20effc67 TL |
41 | MultiIndexContainer& x, |
42 | typename MultiIndexContainer::final_node_type* node) | |
7c673cae FG |
43 | { |
44 | return x.Index::make_iterator(node); | |
45 | } | |
46 | }; | |
47 | ||
48 | } /* namespace multi_index::detail */ | |
49 | ||
50 | } /* namespace multi_index */ | |
51 | ||
52 | } /* namespace boost */ | |
53 | ||
54 | #endif |