Chris@16: // Copyright David Abrahams 2002. Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: #ifndef MAP_ENTRY_DWA2002118_HPP Chris@16: # define MAP_ENTRY_DWA2002118_HPP Chris@16: Chris@16: namespace boost { namespace python { namespace detail { Chris@16: Chris@16: // A trivial type that works well as the value_type of associative Chris@16: // vector maps Chris@16: template Chris@16: struct map_entry Chris@16: { Chris@16: map_entry() {} Chris@16: map_entry(Key k) : key(k), value() {} Chris@16: map_entry(Key k, Value v) : key(k), value(v) {} Chris@16: Chris@16: bool operator<(map_entry const& rhs) const Chris@16: { Chris@16: return this->key < rhs.key; Chris@16: } Chris@16: Chris@16: Key key; Chris@16: Value value; Chris@16: }; Chris@16: Chris@16: template Chris@16: bool operator<(map_entry const& e, Key const& k) Chris@16: { Chris@16: return e.key < k; Chris@16: } Chris@16: Chris@16: template Chris@16: bool operator<(Key const& k, map_entry const& e) Chris@16: { Chris@16: return k < e.key; Chris@16: } Chris@16: Chris@16: Chris@16: }}} // namespace boost::python::detail Chris@16: Chris@16: #endif // MAP_ENTRY_DWA2002118_HPP