Jump to content
  • Advertisement
Sign in to follow this  
Sagar_Indurkhya

Questions about the speed of bitset

This topic is 4776 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am currently in a situation where my chess programming experience(manipulating the bits of integers) is going to come in very very handy. However, in my case, there is n such that n > 64. Therefore, I am looking at the STL's bitset class, which provides and, or, xor, etc, operations. I have 2 questions: 1) I have seen how to declare a bitset using a predefined number, but what if I want to use a variable to specify the number of elements? 2) While I was googling about it, I read some stuff about how bitset is slow, and especially if you are testing each bit.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Sagar_Indurkhya
1) I have seen how to declare a bitset using a predefined number, but what if I want to use a variable to specify the number of elements?


if you mean the size can be specified or changed at run-time then look into boost::dynamic_bitset

Quote:
Original post by Sagar_Indurkhya
2) While I was googling about it, I read some stuff about how bitset is slow, and especially if you are testing each bit.


Sounds like more rubbish myths.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!