ATLAS Offline Software
Loading...
Searching...
No Matches
findInContainer.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: findInContainer.h,v 1.3 2007-06-14 22:38:50 ssnyder Exp $
15
16#ifndef ATHLINKS_FINDINCONTAINER_H
17#define ATHLINKS_FINDINCONTAINER_H
18
19
20namespace SG {
21
22
35template <typename CONT, typename ELT>
36bool
38 const ELT& element,
39 typename CONT::size_type& index)
40{
41 typedef typename CONT::const_iterator const_iterator;
42 const_iterator end = data.end();
43 index = 0;
44 for (const_iterator it = data.begin(); it != end; ++it) {
45 if (*it == element) return true;
46 ++index;
47 }
48 return false;
49}
50
51
52} // namespace SG
53
54
55#endif // ATHLINKS_FINDINCONTAINER_H
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Forward declaration.
bool findInContainer(const CaloCellContainer &data, CaloCell const *const &element, CaloCellContainer::size_type &index)
Definition index.py:1