Giter Club home page Giter Club logo

Comments (3)

martinus avatar martinus commented on September 10, 2024

The idea was to provide heterogenous lookup.

Here is the problem: Say you have e.g. a robin_hood::unordered_map<std::string, int>, and you want to perform lookups but have only e.g. a std::string_view. With the standard interface you need to create a new std::string that's a copy of the std::string_view content to perform the lookup. That's quite a lot of overhead.

The idea is that with is_transparent_tag you create a robin_hood::unordered_map<std::string, int, robin_hood::hash<>, std::equal_to<>> map, and then you can do a lookup with a stringview that can directly hash the stringview and does not need to create a temporary copy.

The interface is currently not working though, because due to lots of refactoring this doesn't work any more. I need to update this.

More info here: https://abseil.io/tips/144
and here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r1.html

I'll leave your question open until I have proper support for this, thanks for reminding me!

from robin-hood-hashing.

martinus avatar martinus commented on September 10, 2024

Latest paper: "Refinement Proposal for P0919 Heterogeneous lookup for unordered containers" http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1690r0.html

from robin-hood-hashing.

shooshx avatar shooshx commented on September 10, 2024

you create a robin_hood::unordered_map<std::string, int, robin_hood::hash<>, std::equal_to<>> map

Do you mind explaining how this works? It doesn't look like robin_hood::hash has is_transparent like std::equal_to has

from robin-hood-hashing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.