Question

I am wondering what the proper way to implement a bitVector in an iOS project is using xcode.

I am pretty new with iOS and just found out I could use the C++ bitvector in my project. Any guidance would be greatly appreciated.

Thanks

Was it helpful?

Solution

Just rename C++ bitvector project class .m files as .mm and add it to Xcode.

Watch a sample video tutorial here

See a sample code tutorial here

See one good Wrapping C++ tutorial here

OTHER TIPS

The "standard" choices for bit vectors in C++ are, in order of decreasing preference:

  • std::bitset for when you know the number of bits at compile time (documentation)
  • boost::dynamic_bitset for when you don't know the number of bits until runtime or need to change the number of bits dynamically (documentation)
  • std::vector<bool> is similar to boost::dynamic_bitset but less preferable. Search google for "std::vector" and you will find much discussion on why it is unfortunate. (documentation)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top