File: hashcode.hh

package info (click to toggle)
lcdf-typetools 2.92%2Bdfsg1-0.1
  • links: PTS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 2,884 kB
  • sloc: cpp: 34,407; ansic: 2,106; sh: 1,032; makefile: 306
file content (31 lines) | stat: -rw-r--r-- 476 bytes parent folder | download | duplicates (20)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef LCDF_HASHCODE_HH
#define LCDF_HASHCODE_HH
#include <stddef.h>

typedef size_t hashcode_t;	///< Typical type for a hashcode() value.

inline hashcode_t
hashcode(int x)
{
    return static_cast<hashcode_t>(x);
}

inline hashcode_t
hashcode(unsigned x)
{
    return static_cast<hashcode_t>(x);
}

inline hashcode_t
hashcode(long x)
{
    return static_cast<hashcode_t>(x);
}

inline hashcode_t
hashcode(unsigned long x)
{
    return static_cast<hashcode_t>(x);
}

#endif