Line data Source code
1 : /* Copyright 2003-2021 Joaquin M Lopez Munoz. 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_INVALIDATE_ITERATORS_HPP 10 : #define BOOST_MULTI_INDEX_DETAIL_INVALIDATE_ITERATORS_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 : /* invalidate_iterators mimics the interface of index_access_sequence (see 23 : * index_access_sequence.hpp) but returns dummy indices whose iterator type 24 : * won't ever match those of the source: the net effect is that safe iterator 25 : * transfer resolves to iterator invalidation, so backbone function invocation 26 : * extract_(x,invalidate_iterators()) is used in extraction scenarios other 27 : * than merging. 28 : */ 29 : 30 : struct invalidate_iterators 31 : { 32 : typedef void iterator; 33 : 34 : invalidate_iterators& get(){return *this;} 35 101122 : invalidate_iterators& next(){return *this;} 36 : }; 37 : 38 : } /* namespace multi_index::detail */ 39 : 40 : } /* namespace multi_index */ 41 : 42 : } /* namespace boost */ 43 : 44 : #endif