GithubHelp home page GithubHelp logo

Comments (5)

Izaron avatar Izaron commented on July 19, 2024

Yes, I was thinking about this issue and wrote this in the closed PR:

But I have a serious doubt connected with implicit conversions from int to bool.
If a programmer paid no attention to warnings and/or had to code really fast, he could write this:

int okay = 42;
/* Transforming 'okay' */
db.set(pos, okay);

The last line was supposed to be db.set(pos, okay != 0) according to the current state, but having a new function dynamic_bitset& set(size_t n, size_t len, bool value = true) makes it into db.set(pos, okay, true) implicitly, which seems to me a serious thing...

And well, it already caused some problems. I consider a possibility to rename this function to smth else. We may have the only function set but multiple versions of function, let's say, change, that do range operations.

from dynamic_bitset.

jeking3 avatar jeking3 commented on July 19, 2024

Sounds good to me. Are you going to issue a PR for that?

from dynamic_bitset.

mclow avatar mclow commented on July 19, 2024

Please resolve this (or revert this) before the freeze beta (7-Nov on the development calendar)

from dynamic_bitset.

jeking3 avatar jeking3 commented on July 19, 2024

@mclow got it.

from dynamic_bitset.

jeking3 avatar jeking3 commented on July 19, 2024

A simpler resolution is to require the "val" to be specified. It allows us to keep the set() name but for range based set you have to indicate what you are setting it to. Seems better than having a differently named change() just for range, or set_range(). If we did set_range, we would need reset_range and flip_range, which really isn't necessary.

from dynamic_bitset.

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.