Giter VIP home page Giter VIP logo

Comments (2)

jonhoo avatar jonhoo commented on June 17, 2024

That's an interesting observation, thank you! You are right that this is a combination of the requirements for ShallowCopy and Eq. It was an oversight that f32 did not implement that trait (all Copy types trivially implement ShallowCopy), and I've rectified that in 5.0.1. I also added some better docs for how to implement it yourself :)

As for Eq, that's harder to do much about for f32; you'll probably need your own newtype wrapper as you observe. Eq is only required for the value type for the remove operation, but I think it'd probably be a mistake to remove that. Technically you can achieve the same thing with just retain, but it's a bit slower and more tedious to use. I also don't see a good way to provide remove only when the value type is Eq due to the operational log that evmap must maintain. If anyone has a good idea there though, I'm all ears!

from left-right.

AttilaOrs avatar AttilaOrs commented on June 17, 2024

Thank you for the fast response.
My best ques is to restrict those operations (mainly remove I guess) for types which do not implement Eq. However, I am far from an expert.
Thank you again.

from left-right.

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.