Garmaine Staff asked 5 years ago

I want to make a bitset in C++. I did a bit of research. All examples I found where like this:

bitset<6> myBitset;
// do something with it

But I don't know the size of the bitset when I define the variable in my class:

#include <bitset>
class Test
     std::bitset *myBitset;

This won't compile…

And initializing like this also doesn't work:

int size = getDependentSizeForBitset();
myBitset = new bitset<size>();