Swift and easy question: is std::bitset
guaranteed to be contiguous in memory?
I know it abides by CopyConstructible and CopyAssignable concepts, but is it also a ContiguousContainer (or something like that) like std::vector
?
Apart from padding, I'd like to make bitwise operations on structures like this:
struct tmp
{
std::bitset<32> b;
unsigned int c;
};
So the contiguity of b
is quite important. Of course, this leads to knowing if std::bitset
is a standard layout class, so that every bitwise operation works.
union { std::bitset<32> b; unsigned int c; };
? – Wolfortstruct
. I want two fields in memory, abitset
and an integer. – Vostok