Rev | Line | |
---|
[857] | 1 |
|
---|
| 2 | // (C) Copyright Daniel James 2005.
|
---|
| 3 | // Use, modification and distribution are subject to the
|
---|
| 4 | // Boost Software License, Version 1.0. (See accompanying file
|
---|
| 5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
---|
| 6 | //
|
---|
| 7 | // Based on Peter Dimov's proposal
|
---|
| 8 | // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
|
---|
| 9 | // issue 6.18.
|
---|
| 10 |
|
---|
| 11 | #if !defined(BOOST_FUNCTIONAL_HASH_VECTOR_HPP)
|
---|
| 12 | #define BOOST_FUNCTIONAL_HASH_VECTOR_HPP
|
---|
| 13 |
|
---|
| 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
---|
| 15 | # pragma once
|
---|
| 16 | #endif
|
---|
| 17 |
|
---|
| 18 | #include <boost/config.hpp>
|
---|
| 19 | #include <vector>
|
---|
| 20 | #include <boost/functional/hash/hash.hpp>
|
---|
| 21 |
|
---|
| 22 | namespace boost
|
---|
| 23 | {
|
---|
| 24 | template <class T, class A>
|
---|
| 25 | std::size_t hash_value(std::vector<T, A> const& v)
|
---|
| 26 | {
|
---|
| 27 | return hash_range(v.begin(), v.end());
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
---|
| 31 | namespace hash_detail
|
---|
| 32 | {
|
---|
| 33 | template <class T, class A>
|
---|
| 34 | struct call_hash<std::vector<T, A> >
|
---|
| 35 | {
|
---|
| 36 | static std::size_t call(std::vector<T, A> const& val)
|
---|
| 37 | {
|
---|
| 38 | return boost::hash_value(val);
|
---|
| 39 | }
|
---|
| 40 | };
|
---|
| 41 | }
|
---|
| 42 | #endif
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.