bitset assignment
From: Andy Skypeck (askypeck_at_earthlink.net)
Date: 12/03/03
- Next message: Peter van Merkerk: "Re: Deleting array allocated with new"
- Previous message: Chris Theis: "Re: Deleting array allocated with new"
- Next in thread: Ron Natalie: "Re: bitset assignment"
- Reply: Ron Natalie: "Re: bitset assignment"
- Reply: Dan W.: "Re: bitset assignment"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 3 Dec 2003 08:45:34 -0800
I have a question concerning the use of the [] operator in bitset
asignment.
bitset<4> a("1100");
bitset<4> b("0011");
a[i] = a[j];
Is clearly supported by the standard, and works with all the C++
compilers I have worked with. But what about
a[i] = 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[i] and
b[j] return type bitset<N>::reference. Others say no, but for
unspecified reasons. Does anybody
have an authoritative answer?
- Next message: Peter van Merkerk: "Re: Deleting array allocated with new"
- Previous message: Chris Theis: "Re: Deleting array allocated with new"
- Next in thread: Ron Natalie: "Re: bitset assignment"
- Reply: Ron Natalie: "Re: bitset assignment"
- Reply: Dan W.: "Re: bitset assignment"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|