annotate DEPENDENCIES/generic/include/boost/python/detail/map_entry.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 // Copyright David Abrahams 2002.
Chris@16 2 // Distributed under the Boost Software License, Version 1.0. (See
Chris@16 3 // accompanying file LICENSE_1_0.txt or copy at
Chris@16 4 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 5 #ifndef MAP_ENTRY_DWA2002118_HPP
Chris@16 6 # define MAP_ENTRY_DWA2002118_HPP
Chris@16 7
Chris@16 8 namespace boost { namespace python { namespace detail {
Chris@16 9
Chris@16 10 // A trivial type that works well as the value_type of associative
Chris@16 11 // vector maps
Chris@16 12 template <class Key, class Value>
Chris@16 13 struct map_entry
Chris@16 14 {
Chris@16 15 map_entry() {}
Chris@16 16 map_entry(Key k) : key(k), value() {}
Chris@16 17 map_entry(Key k, Value v) : key(k), value(v) {}
Chris@16 18
Chris@16 19 bool operator<(map_entry const& rhs) const
Chris@16 20 {
Chris@16 21 return this->key < rhs.key;
Chris@16 22 }
Chris@16 23
Chris@16 24 Key key;
Chris@16 25 Value value;
Chris@16 26 };
Chris@16 27
Chris@16 28 template <class Key, class Value>
Chris@16 29 bool operator<(map_entry<Key,Value> const& e, Key const& k)
Chris@16 30 {
Chris@16 31 return e.key < k;
Chris@16 32 }
Chris@16 33
Chris@16 34 template <class Key, class Value>
Chris@16 35 bool operator<(Key const& k, map_entry<Key,Value> const& e)
Chris@16 36 {
Chris@16 37 return k < e.key;
Chris@16 38 }
Chris@16 39
Chris@16 40
Chris@16 41 }}} // namespace boost::python::detail
Chris@16 42
Chris@16 43 #endif // MAP_ENTRY_DWA2002118_HPP