MFC extension class CBitArray

Environment: Visual C++ 6, Windows 95/98/Me/NT/2000/XP

The class CBitArray behaves like a specialization of the MFC template class CArray. A real specialization is not possible because of a missing simple data type for a bit.

For maximum efficiency the bits are packed into a dynamic array of unsigned longs. You can easily modify the type of the date containing the bits (see typedef ULONG T in the declaration of CBitArray). CBitArray implements all member functions of the MFC class including the operator function [] (both for l-values and r-values).

The private member functions Copylr, Copyrl, and X are derived from the same-named functions of the class bitstring written by P.J. Plauger and are published with permission of the author.

Downloads

Download demo project - 23 Kb
Download source - 4 Kb


About the Author

Thomas Holte

Born in 1953 I'm a passionate programmer since 30 years. I'm employed as a software developer at a large company in Nuremberg, Germany. My hobbies are programming (what else) and digital photography.

Comments

  • Spitze!

    Posted by Legacy on 11/28/2001 12:00am

    Originally posted by: Catmad

    Hi!

    Vielen Dank f�r die CBitArray Klasse!
    Hab mich immerzu mit der bitset Template herumgeschlagen...

    Ciao
    Catmad

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Hybrid cloud platforms need to think in terms of sweet spots when it comes to application platform interface (API) integration. Cloud Velocity has taken a unique approach to tight integration with the API sweet spot; enough to support the agility of physical and virtual apps, including multi-tier environments and databases, while reducing capital and operating costs. Read this case study to learn how a global-level Fortune 1000 company was able to deploy an entire 6+ TB Oracle eCommerce stack in Amazon Web …

  • Corporate e-Learning technology has a long and diverse pedigree. As far back as the 1980s, companies were adopting computer-based training to supplement traditional classroom activities. More recently, rich web-based applications have added streaming audio and video, real-time collaboration and other new tools to the e-Learning mix. At the same time, the growing availability of informal learning tools--a category that includes everything from web searches to social media posts--are having a major impact on …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds