invalidate_iterators.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #ifndef BOOST_MULTI_INDEX_DETAIL_INVALIDATE_ITERATORS_HPP
  9. #define BOOST_MULTI_INDEX_DETAIL_INVALIDATE_ITERATORS_HPP
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. namespace boost{
  14. namespace multi_index{
  15. namespace detail{
  16. /* invalidate_iterators mimics the interface of index_access_sequence (see
  17. * index_access_sequence.hpp) but returns dummy indices whose iterator type
  18. * won't ever match those of the source: the net effect is that safe iterator
  19. * transfer resolves to iterator invalidation, so backbone function invocation
  20. * extract_(x,invalidate_iterators()) is used in extraction scenarios other
  21. * than merging.
  22. */
  23. struct invalidate_iterators
  24. {
  25. typedef void iterator;
  26. invalidate_iterators& get(){return *this;}
  27. invalidate_iterators& next(){return *this;}
  28. };
  29. } /* namespace multi_index::detail */
  30. } /* namespace multi_index */
  31. } /* namespace boost */
  32. #endif