[Boost-bugs] [Boost C++ Libraries] #12765: Provide heterogeneous lookup methods using the container's hasher and/or comparator functions

Subject: [Boost-bugs] [Boost C++ Libraries] #12765: Provide heterogeneous lookup methods using the container's hasher and/or comparator functions
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-01-16 23:50:08


#12765: Provide heterogeneous lookup methods using the container's hasher and/or
comparator functions
------------------------------+--------------------------
 Reporter: fdegros@… | Owner: igaztanaga
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: intrusive
  Version: Boost 1.63.0 | Severity: Optimization
 Keywords: |
------------------------------+--------------------------
 Boost intrusive containers have heterogeneous lookup methods taking a key
 of an arbitrary type. All these methods also require to pass a hasher
 and/or a comparison function dealing with this key type. But what if the
 hasher/comparator embedded in the container itself can already deal with
 these key type? I'd like to avoid passing to these methods a function that
 the container already knows about.

 Consider adding heterogeneous lookup methods using the hasher and/or
 comparator already stored in the container.

 Like std::set or std::map, you might want to enable these methods only if
 the hasher and comparator declare a {{{is_transparent}}} nested type. See
 http://en.cppreference.com/w/cpp/container/map/find.

 Something like:

 {{{
 template <typename T, class... Options>
 class set {
  public:
   ...

   template <typename K, typename = key_compare::is_transparent>
   iterator find(const K& key) { return find(key, key_comp()); }
   ...
 };
 }}}

 That would make these heterogeneous lookup methods more convenient to use.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12765>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC