Created on 2008-09-26.00:00:00 last changed 161 months ago
Proposed resolution:
Undo the addition of the constexpr specifier to the test member function in both class declaration [template.bitset] p.1 and in the member description before [bitset.members] p.56, assuming that 720 was applied.
constexprbool test(size_t pos) const;
Change the returns clause p. 66 to read:
Returns:
test(pos)true if the bit at position pos in *this has the value one, otherwise false.
[ Batavia (2009-05): ]
We agree with the proposed resolution. Move to Tentatively Ready.
[ Post Summit: ]
Lawrence: proposed resolutions A, B, C are mutually exclusive.
Recommend Review with option C.
The current standard 14882::2003(E) as well as the current draft N2723 have in common a contradiction of the operational semantics of member function test [bitset.members] p.56-58 and the immutable member operator[] overload [bitset.members] p.64-66 (all references are defined in terms of N2723):
bool test(size_t pos) const;
Requires: pos is valid
Throws: out_of_range if pos does not correspond to a valid bit position.
Returns: true if the bit at position pos in *this has the value one.
constexpr bool operator[](size_t pos) const;
Requires: pos shall be valid.
Throws: nothing.
Returns: test(pos).
Three interpretations:
The problem became worse, because issue 720 recently voted into WP argued that member test logically must be a constexpr function, because it was used to define the semantics of another constexpr function (the operator[] overload).
Three alternatives are proposed, corresponding to the three bullets (A), (B), and (C), the author suggests to follow proposal (C).
Proposed alternatives:
Remove the constexpr specifier in front of operator[] overload and undo that of member test (assuming 720 is accepted) in both the class declaration [template.bitset]/1 and in the member description before [bitset.members]/56 and before /64 to read:
constexprbool test(size_t pos) const; ..constexprbool operator[](size_t pos) const;
Change the throws clause of p. 65 to read:
Throws:
nothingout_of_range if pos does not correspond to a valid bit position.
Replace the throws clause p. 57 to read:
Throws:
out_of_range if pos does not correspond to a valid bit positionnothing.
Undo the addition of the constexpr specifier to the test member function in both class declaration [template.bitset]/1 and in the member description before [bitset.members]/56, assuming that 720 was applied.
constexprbool test(size_t pos) const;
Change the returns clause p. 66 to read:
Returns:
test(pos)true if the bit at position pos in *this has the value one, otherwise false.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2011-04-24 20:26:46 | admin | set | messages: + msg5748 |
2011-04-24 20:26:46 | admin | set | messages: + msg5747 |
2011-04-24 20:26:46 | admin | set | messages: + msg5746 |
2008-09-26 00:00:00 | admin | create |