A
Andy Skypeck
I have a question concerning the use of the [] operator in bitset
asignment.
bitset<4> a("1100");
bitset<4> b("0011");
a = a[j];
Is clearly supported by the standard, and works with all the C++
compilers I have worked with. But what about
a = b[j]; // ?
Assume that there are no indices out of range.
This works with gcc-3.* and MSVC 6 and higher but fails on an older
Borland compiler. I contend that this is ok because both a and
b[j] return type bitset<N>::reference. Others say no, but for
unspecified reasons. Does anybody
have an authoritative answer?
asignment.
bitset<4> a("1100");
bitset<4> b("0011");
a = a[j];
Is clearly supported by the standard, and works with all the C++
compilers I have worked with. But what about
a = b[j]; // ?
Assume that there are no indices out of range.
This works with gcc-3.* and MSVC 6 and higher but fails on an older
Borland compiler. I contend that this is ok because both a and
b[j] return type bitset<N>::reference. Others say no, but for
unspecified reasons. Does anybody
have an authoritative answer?