vector<bool>::const_reference and vector<bool>::const_iterator::reference should be the same type.
Details
- Reviewers
Mordante var-const - Group Reviewers
Restricted Project - Commits
- rG907ed12d950f: [libc++] Change vector<bool>::const_iterator::reference to bool in ABIv2
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I see _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL isn't mentioned in the release notes, can you add an entry?
LGTM modulo some small nits.
libcxx/test/std/containers/sequences/vector.bool/iterators.pass.cpp | ||
---|---|---|
35 | Interestingly the test libcxx/test/std/containers/sequences/vector.bool/types.pass.cpp isn't affected. It would be nice when you can add the const_reference to the synopsis and add tests for pointer, const_pointer, and const_reference. |
- Address comments
libcxx/test/std/containers/sequences/vector.bool/iterators.pass.cpp | ||
---|---|---|
35 | I don't think there is anything portable to test for pointer and const_pointer. |
LGTM with one suggestion.
libcxx/test/std/containers/sequences/vector.bool/types.pass.cpp | ||
---|---|---|
27 | For consistency I would use a typedef here. |
libcxx/include/__bit_reference | ||
---|---|---|
1115 | Hi. This line causes breakages when compiling with -std=c++03: /include/libcxx/__bit_reference:1115:79: error: a space is required between consecutive right angle brackets (use '> >') using reference = typename conditional<_IsConst, bool, __bit_reference<_Cp>>::type; ^ Could you please fix this? |
libcxx/include/__bit_reference | ||
---|---|---|
1115 | Fixed it in 6b257a. Just out of interest, why do you use the unstable ABI in C++03? It's clearly not for ABI reasons. Also as a side note: I don't think we officially support using the unstable ABI pre-C++11, so you should probably not use that combination. But the fix is simple enough. |
libcxx/include/__bit_reference | ||
---|---|---|
1115 | Because we are an embedded toolchain vendor and ABI stability is less of a concern for us, so we use a custom subset of unstable ABI features (and _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL improves results of conformance tests). We do claim C++03 support, though.
I was not aware of this; thanks for pointing it out. |
libcxx/include/__bit_reference | ||
---|---|---|
1115 |
Thanks. |
Hi. This line causes breakages when compiling with -std=c++03:
Could you please fix this?