7:1
 ?÷     def __iter__(self):
            return self

        def __next__(self):
            count = self.count
            self.count = self.count + 1
            if self.bitvec:
                if self.item == self.finish and self.so >= self.fo:
                    raise StopIteration
                elt = bool(self.item.dereference() & (1 << self.so))
                self.so = self.so + 1
                if self.so >= self.isize:
                    self.item = self.item + 1
                    self.so = 0
                return ('[%d]' % count, elt)
            else:
                if self.item == self.finish:
                    raise StopIteration
                elt = self.item.dereference()
                self.item = self.item + 1
                return ('[%d]' % count, elt)

    def __init__(self, typename, val):
        self.typename = strip_versioned_namespace(typename)
        self.val = val
        self.is_bool = val.type.template_argument(0).code == gdb.TYPE_CODE_BOOL

    def children(self):
        return self._iterator(self.val['_M_impl']['_M_start'],
                              self.val['_M_impl']['_M_finish'],
                              self.is_bool)

    def to_string(self):
        start = self.val['_M_impl']['_M_start']
        finish = self.val['_M_impl']['_M_finish']
        end = self.val['_M_impl']['_M_end_of_storage']
        if self.is_bool:
            start = self.val['_M_impl']['_M_start']['_M_p']
            finish = self.val['_M_impl']['_M_finish']['_M_p']
            fo     = self.val['_M_impl']['_M_finish']['_M_offset']
            itype = start.dereference().type
            bl = 8 * itype.sizeof
            length   = bl * (finish - start) + fo
            capacity = bl * (end - start)
            return ('%s<bool> of length %d, capacity %d'
                    % (self.typename, int (length), int (capacity)))
        else:
            return ('%s of length %d, capacity %d'
                    % (self.typename, int (finish - start), int (end - start)))

    def display_hint(self):
        return 'array'

class StdVectorIteratorPrinter:
    "Print std::vector::iterator"

    def __init__(self, typename, val):
        self.val = val

    def to_string(self):
        if not self.val['_M_current']:
            return 'non-dereferenceable iterator for std::vector'
        return str(self.val['_M_current'].dereference())

class StdBitIteratorPrinter:
    "Print std::vector<bool>'s _Bit_iterator and _Bit_const_iterator"

    def __init__(self, typename, val):
        self.val = val

    def to_string(self):
        if not self.val['_M_p']:
            return 'non-dereferenceable iterator for std::vector<bool>'
        return bool(self.val['_M_p'].dereference() & (1 << self.val['_M_offset']))

class StdBitReferencePrinter:
    "Print std::vector<bool>::reference"

    def __init__(self, typename, val):
        self.val = val

    def to_string(self):
        if not self.val['_M_p']:
            return 'invalid std::vector<bool>::reference'
        return bool(self.val['_M_p'].dereference() & (self.val['_M_mask']))

class StdTuplePrinter:
    "Print a std::tuple"

    class _iterator(Iterator):
        @staticmethod
        def _is_nonempty_tuple (nodes):
            if len (nodes) == 2:
                if is_specialization_of (nodes[1].type, '__tuple_base'):
                    return True
            elif len (nodes) == 1:
                return True
            elif len (nodes) == 0:
                return False
            raise ValueError("Top of tuple tree does not consist of a single node.")

        def __init__ (self, head):
            self.head = head

            # Set the base class as the initial head of the
            # tuple.
            nodes = self.head.type.fields ()
            if self._is_nonempty_tuple (nodes):
                # Set the actual head to the first pair.
                self.head  = self.head.cast (nodes[0].type)
            self.count = 0

        def __iter__ (self):
            return self

        def __next__ (self):
            # Check for f