Category : bitset

I want to have a bitset constexpr variable in my program. bitset can have unsigned long long value as a constructor which is 64bit value, I need 100 bit value. As per this Q&A, we can use constructor that takes a string as an argument and initialize it that way, but it won’t be constexpr ..

Read more

Im currently trying to declare an array of 17 std::bitsets, each 32 bits long. I’m doing it like this: std::bitset<32> mTestInstruction[17] { std::string("01000000001000000000000000000001"), std::string("01000000011000000000000001100011"), std::string("01000000101000000000000000000001"), std::string("10100000000000000000000000001010"), std::string("00000000100000010000000010000010"), std::string("00000000110001010010000000000001"), std::string("01001000111001010000000000000000"), std::string("01000100001000110000000000000011"), std::string("01000000001000010000000000000001"), std::string("10000000000000000000000000000011"), std::string("00000000010000000000000000000001"), std::string("00000000111000000000000000000001"), std::string("00000000111001110000100000000001"), std::string("01000000010000100000000000000001"), std::string("01000100001000100000000000000010"), std::string("10000000000000000000000000001100"), std::string("11100000000000000000000000001000"), }; And I’m receiving the following error: error: could not convert ‘std::__cxx11::basic_string<char>(((const char*)"01000000001000000000000000000001"), std::allocator<char>())’ from ‘std::__cxx11::string ..

Read more