Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/multi_index/detail/converter.hpp @ 44

Last change on this file since 44 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.3 KB
Line 
1/* Copyright 2003-2005 Joaquín M López Muñoz.
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)&&(_MSC_VER>=1200)
13#pragma once
14#endif
15
16namespace boost{
17
18namespace multi_index{
19
20namespace 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
27template<typename MultiIndexContainer,typename Index>
28struct 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(
34    const MultiIndexContainer& x,typename MultiIndexContainer::node_type* node)
35  {
36    return x.Index::make_iterator(node);
37  }
38
39  static typename Index::iterator iterator(
40    MultiIndexContainer& x,typename MultiIndexContainer::node_type* node)
41  {
42    return x.Index::make_iterator(node);
43  }
44};
45
46} /* namespace multi_index::detail */
47
48} /* namespace multi_index */
49
50} /* namespace boost */
51
52#endif
Note: See TracBrowser for help on using the repository browser.