By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,389 Members | 1,844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,389 IT Pros & Developers. It's quick & easy.

std: bitsets of variable size

P: n/a
Hi,

I need the STL class "bitset" with all its
algorithms and a variable size which can
be increased dynamically.

The ordinary stl bitset have to be fixed in
size at compile time.

Any ideas to solve that problem?

Thanks
Chris
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Christian Christmann a écrit :
Hi,

I need the STL class "bitset" with all its
algorithms and a variable size which can
be increased dynamically.

The ordinary stl bitset have to be fixed in
size at compile time.

Any ideas to solve that problem?

Thanks
Chris

http://www.boost.org/libs/dynamic_bi...ic_bitset.html
Jul 23 '05 #2

P: n/a
Vince wrote:
Christian Christmann a écrit :
Hi,

I need the STL class "bitset" with all its
algorithms and a variable size which can
be increased dynamically.

The ordinary stl bitset have to be fixed in
size at compile time.

Any ideas to solve that problem?

Thanks
Chris

http://www.boost.org/libs/dynamic_bi...ic_bitset.html


That'll work fine, provided the OP can use Boost. A standards
compliant (and therefore not OT) solution would be to use a
deque<bool>.

Kristo

Jul 23 '05 #3

P: n/a
Kristo wrote:
Vince wrote:
Christian Christmann a écrit :
Hi,

I need the STL class "bitset" with all its
algorithms and a variable size which can
be increased dynamically.

The ordinary stl bitset have to be fixed in
size at compile time.

Any ideas to solve that problem?

Thanks
Chris

http://www.boost.org/libs/dynamic_bi...ic_bitset.html


That'll work fine, provided the OP can use Boost. A standards
compliant (and therefore not OT) solution would be to use a
deque<bool>.


On second thought, that's not entirely correct, because a bitset has a
bunch of functions not found in other STL containers. The only
standards complaint solution, therefore, is to roll your own. Using a
deque<bool> as an underlying container will probably help with that.

Kristo

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.