libstdc++: Pretty printers for _Bit_reference and _Bit_iterator
authorMichael Weghorn <m.weghorn@posteo.de>
Tue, 1 Dec 2020 21:19:20 +0000 (21:19 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 1 Dec 2020 21:35:32 +0000 (21:35 +0000)
commit39836f8324d819459cb21198e95b993588c6a2b1
tree09a17861418986fb85ef54d6e737ba047b16bc3c
parent968666a011b904f70d12e52180d361faaedfd3a2
libstdc++: Pretty printers for _Bit_reference and _Bit_iterator

'std::_Bit_iterator' and 'std::_Bit_const_iterator' are the iterators
used by 'std::vector<bool>'.
'std::_Bit_reference' is e.g. used in range-based for loops over
'std::vector<bool>'  like

    std::vector<bool> vb {true, false, false};
    for (auto b : vb) {
        // b is of type std::_Bit_reference here
        // ...
    }

Like iterators of vectors for other types, the actual value is printed.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py (StdBitIteratorPrinter)
(StdBitReferencePrinter): Add pretty-printers for
_Bit_reference, _Bit_iterator and _Bit_const_iterator.
* testsuite/libstdc++-prettyprinters/simple.cc: Test
std::_Bit_reference, std::_Bit_iterator and
std::_Bit_const_iterator.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc