Comments (5)
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 functiondynamic_bitset& set(size_t n, size_t len, bool value = true)
makes it intodb.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.
Sounds good to me. Are you going to issue a PR for that?
from dynamic_bitset.
Please resolve this (or revert this) before the freeze beta (7-Nov on the development calendar)
from dynamic_bitset.
@mclow got it.
from dynamic_bitset.
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)
- Valgrind failures in test4 with wchar_t support enabled HOT 4
- Adding hardware supported popcount (and other functions) HOT 2
- Release notes for 1.69.0 HOT 2
- Hardware supported popcount breaks on Windows with CPUs that don't support SSE4 HOT 11
- need to use this as a key in an unordered_map HOT 8
- MSVC hardware-assisted popcount implementation
- Release Notes for 1.70.0 HOT 1
- gcc-4.8 on xenial fails unit test 4 (streaming)
- Coverity flagged issue (investigate) HOT 1
- Release Notes for 1.71.0 HOT 1
- std::vector<boost::dynamic_bitset<>>unable to free memory HOT 5
- dynamic_bitset cannot be used in a parallel program HOT 3
- boost/dynamic_bitset/dynamic_bitset.hpp:111:20: -Wdeprecated-copy warning
- Release notes for 1.80
- Hide internals (dispatch_init(), init_from_block_range(), m_append())
- Possible improvement for is_proper_subset_of
- It seems that the latest develop branch has 'stdext::hash_value' compile failure
- Make buffer_type changeable
- Missing change in Boost 1.80.0 Unix distributable as opposed to the Windows one
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamic_bitset.