ATLAS Offline Software
Loading...
Searching...
No Matches
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 $
14
15
16#ifndef SGTOOLS_PTRHASH_H
17#define SGTOOLS_PTRHASH_H
18
19
20#include <cstdlib>
21
22
23namespace SG {
24
25
40struct 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
#define x
Forward declaration.
Improved hash function for pointers.
Definition ptrhash.h:41
std::size_t operator()(const void *p) const
Definition ptrhash.h:42