1 /** @file
2 * Hash function for various things
3 */
4 /* Authors:
5 * Krzysztof KosiĆski <tweenk.pl@gmail.com>
6 *
7 * Copyright (C) 2009 Authors
8 * Released under GNU GPL, read the file 'COPYING' for more information
9 */
11 #ifndef SEEN_UTIL_HASH_H
12 #define SEEN_UTIL_HASH_H
14 #include <boost/shared_ptr.hpp>
16 namespace __gnu_cxx {
18 /** Hash function for Boost shared pointers */
19 template <typename T>
20 struct hash< boost::shared_ptr<T> > : public std::unary_function<boost::shared_ptr<T>, size_t> {
21 size_t operator()(boost::shared_ptr<T> p) const {
22 return reinterpret_cast<size_t>(p.get());
23 }
24 };
26 } // namespace __gnu_cxx
28 #endif
30 /*
31 Local Variables:
32 mode:c++
33 c-file-style:"stroustrup"
34 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
35 indent-tabs-mode:nil
36 fill-column:99
37 End:
38 */
39 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :