Coder Social home page Coder Social logo

Expand Bitset about sea HOT 5 CLOSED

thm-mni-ii avatar thm-mni-ii commented on September 22, 2024
Expand Bitset

from sea.

Comments (5)

jmeintrup avatar jmeintrup commented on September 22, 2024
//static procedures:
Bitset operator&(Bitset&, Bitset&);
Bitset operator|(Bitset&, Bitset&);
Bitset operator~();

//constructors:
Bitset(Bitset&); 

Will do.

unsigned long to_ulong();

This implementation allows direct access to the underlying data via the functions getBlock and setBlock. Is this needed? to_ulong only works for bitsets with <= 64 bits. I can implement it if it's needed.

Bitset(sizetype bits, unsigned long value);

Similiar to the function to_ulong, since we can set blocks directly via setBlock, is this needed?
Currently blocks are unsinged char based. It is probably better to change it to unsinged long altogether.
If this exact behavior is needed, i can implement it.

from sea.

shsr04 avatar shsr04 commented on September 22, 2024

Either change blocktype to unsigned long. This enables simple setting/getting of the first block and treat it as a number.

Or, if you want to keep the byte access, please implement the unsigned long variants in addition.

from sea.

shsr04 avatar shsr04 commented on September 22, 2024

@1yay1 Note: operator~ is not a static procedure, it is a member of the Bitset class. I edited the description to fix this.

from sea.

jmeintrup avatar jmeintrup commented on September 22, 2024

Implemented the functions.
The default behavior of the copy constructor works correctly for this class, so no implementation is needed

from sea.

shsr04 avatar shsr04 commented on September 22, 2024

I have made some more adjustments to the bitset (included in #13).

from sea.

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.