I can't figure out if I'm doing anything wrong here, hopefully someone here can enlighten me.
I have a class Flags
, this is an extremely simplified version but I declare a bitset
class Flags
{
private:
//List of 8 bits
std::bitset<8> _P;
public:
Flags();
}
On my constructor I initialise it as
Flags::Flags()
: _P(32ul)
{}
But it won't compile and gives me the error
error C2668: 'std::bitset<_Bits>::bitset' : ambiguous call to overloaded function
This is compiled in VS2010 SP1 64 bit but as a 32bit program
EDIT
Accepted answer is for the above but as a side note could anyone explain why when using the default constructor (which should initialise them all to zero's) they aren't all set to zero's?
_p.to_ulong()
returns 1390560944 and _p looks like
[8](0,0,0,0,1,1,0,1)