ATLAS Offline Software
ptrhash.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: ptrhash.h,v 1.1 2008-04-08 16:05:32 ssnyder Exp $
16 #ifndef SGTOOLS_PTRHASH_H
17 #define SGTOOLS_PTRHASH_H
18 
19 
20 #include <cstdlib>
21 
22 
23 namespace SG {
24 
25 
40 struct ptrhash
41 {
42  std::size_t operator() (const void* p) const
43  {
44  std::size_t x = reinterpret_cast<std::size_t> (p);
45  return (x>>3) ^ (x&7);
46  }
47 };
48 
49 
50 } // namespace SG
51 
52 
53 #endif // not SGTOOLS_PTRHASH_H
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
x
#define x
SG::ptrhash::operator()
std::size_t operator()(const void *p) const
Definition: ptrhash.h:42
SG::ptrhash
Improved hash function for pointers.
Definition: ptrhash.h:41