I'd like to have an interface whose function returns a bitset:
class IMyInterface
{
public:
virtual std::bitset<100> GetBits() = 0;
};
The problem is that I don't want to force the size of the bitset
. So I think I have to use boost::dynamic_bitset
instead:
class IMyInterface
{
public:
virtual boost::dynamic_bitset<> GetBits() = 0;
};
I have heard that boost::dynamic_bitset
is slower than std::bitset
though. Is there any other way to avoid using dynamic_bitset
and have an interface that returns a std::bitset
whose size is determined by the implementors?