Giter Site home page Giter Site logo

Comments (8)

manugoyal avatar manugoyal commented on August 24, 2024

I added support for this feature in a new branch 75ad4e0. Since it requires compiling with C++14, while everything else compiles with C++11, I haven't yet bothered to incorporate the unit test into the build system, which I want to do before merging into master. Until then, though, would you mind trying this branch out and seeing if it works for your purposes?

from libcuckoo.

manugoyal avatar manugoyal commented on August 24, 2024

Merged into master.

from libcuckoo.

toojays avatar toojays commented on August 24, 2024

Thanks Manu. It might be a little while before I can test this. :(

Is the only reason you need C++14 because you're using std::equal_to in your test program? I guess I'll find out when I try it, but I'm looking to use this in a C++11 project. Hopefully that's just a matter of defining an appropriate functor, not something I need new language features for.

from libcuckoo.

manugoyal avatar manugoyal commented on August 24, 2024

Yeah I'm using std::equal_to, but with a void overload that was added in c++14 and not supported in c++11. The document you linked me explains how that works. Not sure if it's possible to implement such a comparator in c++11 because the void overload is not supported I think.

from libcuckoo.

toojays avatar toojays commented on August 24, 2024

I'm hoping I can get away with having a non-template function object which just has the necessary overloads of operator()(). If my hashtable has keys of type std::string, as long as my Pred functor has an overload for operator()(const std::string &, const char *) (and maybe vice-versa), it looks like it should work. But I haven't tried it yet.

from libcuckoo.

manugoyal avatar manugoyal commented on August 24, 2024

Oh yeah that could work. That's what I'm doing for the hash function in the test, so maybe I can change that for the comparator too.

from libcuckoo.

manugoyal avatar manugoyal commented on August 24, 2024

I just pushed an update that removes the c++14 dependency, using an overloaded class instead of std::equal_to<>.

from libcuckoo.

toojays avatar toojays commented on August 24, 2024

Sorry it took so long for me to test this. It appears to do exactly what I want, and works fine in C++11 mode.

Thanks!

from libcuckoo.

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.