Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/python/detail/map_entry.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 // Copyright David Abrahams 2002. | |
2 // Distributed under the Boost Software License, Version 1.0. (See | |
3 // accompanying file LICENSE_1_0.txt or copy at | |
4 // http://www.boost.org/LICENSE_1_0.txt) | |
5 #ifndef MAP_ENTRY_DWA2002118_HPP | |
6 # define MAP_ENTRY_DWA2002118_HPP | |
7 | |
8 namespace boost { namespace python { namespace detail { | |
9 | |
10 // A trivial type that works well as the value_type of associative | |
11 // vector maps | |
12 template <class Key, class Value> | |
13 struct map_entry | |
14 { | |
15 map_entry() {} | |
16 map_entry(Key k) : key(k), value() {} | |
17 map_entry(Key k, Value v) : key(k), value(v) {} | |
18 | |
19 bool operator<(map_entry const& rhs) const | |
20 { | |
21 return this->key < rhs.key; | |
22 } | |
23 | |
24 Key key; | |
25 Value value; | |
26 }; | |
27 | |
28 template <class Key, class Value> | |
29 bool operator<(map_entry<Key,Value> const& e, Key const& k) | |
30 { | |
31 return e.key < k; | |
32 } | |
33 | |
34 template <class Key, class Value> | |
35 bool operator<(Key const& k, map_entry<Key,Value> const& e) | |
36 { | |
37 return k < e.key; | |
38 } | |
39 | |
40 | |
41 }}} // namespace boost::python::detail | |
42 | |
43 #endif // MAP_ENTRY_DWA2002118_HPP |