Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,

I am trying to use a dynamic bitset in a struct and then initialize the size at runtime. For the struct this works:

struct s{
boost::dynamic_bitset<> x();
}s1;

But now how do I use it in the code? For instance how would I resize it? This does not work for me:

s1.x.resize(5);

What am I supposed to use?
Posted
Updated 14-Apr-10 13:25pm
v3

"x()" should be only "x" then you can use it properly
 
Share this answer
 
Try to find one (or two) difference(s) to your code :) :
struct {
  int iVar;
} s;
 

void Test()
{
  s.iVar = 0;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900