ATLAS Offline Software
DVL_iter_swap.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
16 #ifndef ATHCONTAINERS_TOOLS_DVL_ITER_SWAP_H
17 #define ATHCONTAINERS_TOOLS_DVL_ITER_SWAP_H
18 
19 
22 #include <iterator>
23 
24 
25 namespace std {
26 
27 
35 template <class DV>
38 {
39  DV::iter_swap (a, b);
40 }
41 
42 
50 template <class DV>
51 void
52 iter_swap (typename std::reverse_iterator<DataModel_detail::iterator<DV> > a,
53  typename std::reverse_iterator<DataModel_detail::iterator<DV> > b)
54 {
57  --ai;
58  --bi;
59  DV::iter_swap (ai, bi);
60 }
61 
62 
72 template <class DV>
77 {
78 
79  for (; first1 != last1; ++first1, ++first2)
80  std::iter_swap(first1, first2);
81  return first2;
82 }
83 
84 
94 template <class DV>
95 std::reverse_iterator<DataModel_detail::iterator<DV> >
96 swap_ranges (std::reverse_iterator<DataModel_detail::iterator<DV> > first1,
97  std::reverse_iterator<DataModel_detail::iterator<DV> > last1,
98  std::reverse_iterator<DataModel_detail::iterator<DV> > first2)
99 {
100 
101  for (; first1 != last1; ++first1, ++first2)
102  std::iter_swap(first1, first2);
103  return first2;
104 }
105 
106 
107 } // namespace std
108 
109 
110 #endif // not ATHCONTAINERS_TOOLS_DVL_ITER_SWAP_H
std::swap_ranges
DataModel_detail::iterator< DV > swap_ranges(DataModel_detail::iterator< DV > first1, DataModel_detail::iterator< DV > last1, DataModel_detail::iterator< DV > first2)
Specialization of swap_ranges for DataVector/DataList.
Definition: DVL_iter_swap.h:74
std::iter_swap
void iter_swap(typename std::reverse_iterator< DataModel_detail::iterator< DV > > a, typename std::reverse_iterator< DataModel_detail::iterator< DV > > b)
Specialization of iter_swap for DataVector/DataList.
Definition: DVL_iter_swap.h:52
ATHCONTAINERS_ASSERT.h
An overridable variant of assert.
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
std::iter_swap
void iter_swap(typename DataModel_detail::iterator< DV > a, typename DataModel_detail::iterator< DV > b)
Specialization of iter_swap for DataVector/DataList.
Definition: DVL_iter_swap.h:36
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
DVLIterator.h