Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:06

0001 /* Copyright 2003-2020 Joaquin M Lopez Munoz.
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * See http://www.boost.org/libs/multi_index for library home page.
0007  */
0008 
0009 #ifndef BOOST_MULTI_INDEX_DETAIL_CONVERTER_HPP
0010 #define BOOST_MULTI_INDEX_DETAIL_CONVERTER_HPP
0011 
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015 
0016 namespace boost{
0017 
0018 namespace multi_index{
0019 
0020 namespace detail{
0021 
0022 /* converter offers means to access indices of a given multi_index_container
0023  * and for convertibilty between index iterators, so providing a
0024  * localized access point for get() and project() functions.
0025  */
0026 
0027 template<typename MultiIndexContainer,typename Index>
0028 struct converter
0029 {
0030   static const Index& index(const MultiIndexContainer& x){return x;}
0031   static Index&       index(MultiIndexContainer& x){return x;}
0032 
0033   static typename Index::const_iterator const_iterator(
0034     const MultiIndexContainer& x,
0035     typename MultiIndexContainer::final_node_type* node)
0036   {
0037     return x.Index::make_iterator(node);
0038   }
0039 
0040   static typename Index::iterator iterator(
0041     MultiIndexContainer& x,
0042     typename MultiIndexContainer::final_node_type* node)
0043   {
0044     return x.Index::make_iterator(node);
0045   }
0046 };
0047 
0048 } /* namespace multi_index::detail */
0049 
0050 } /* namespace multi_index */
0051 
0052 } /* namespace boost */
0053 
0054 #endif