/* Copyright 2003-2021 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * See http://www.boost.org/libs/multi_index for library home page. */ #ifndef BOOST_MULTI_INDEX_DETAIL_INDEX_ACCESS_SEQUENCE_HPP #define BOOST_MULTI_INDEX_DETAIL_INDEX_ACCESS_SEQUENCE_HPP #if defined(_MSC_VER) #pragma once #endif #include /* keep it first to prevent nasty warns in MSVC */ #include #include #include namespace boost{ namespace multi_index{ namespace detail{ /* Successive access to the indices of a multi_index_container. Used as dst in * backbone function extract_(x,dst) to retrieve the destination indices * where iterators referring to x must be transferred to (in merging * operations). */ template struct index_access_sequence; struct index_access_sequence_terminal { index_access_sequence_terminal(void*){} }; template struct index_access_sequence_normal { MultiIndexContainer* p; index_access_sequence_normal(MultiIndexContainer* p_):p(p_){} typename nth_index::type& get(){return p->template get();} index_access_sequence next(){return index_access_sequence(p);} }; template struct index_access_sequence_base: mpl::if_c< N::type::value, index_access_sequence_normal, index_access_sequence_terminal > {}; template struct index_access_sequence: index_access_sequence_base::type { typedef typename index_access_sequence_base< MultiIndexContainer,N>::type super; index_access_sequence(MultiIndexContainer* p):super(p){} }; } /* namespace multi_index::detail */ } /* namespace multi_index */ } /* namespace boost */ #endif