def __init__ (self, typename, val):
self.val = val
- impl_type = val.type.fields()[0].type.tag
+ impl_type = val.type.fields()[0].type.strip_typedefs()
# Check for new implementations first:
if is_specialization_of(impl_type, '__uniq_ptr_data') \
or is_specialization_of(impl_type, '__uniq_ptr_impl'):
elif is_specialization_of(impl_type, 'tuple'):
tuple_member = val['_M_t']
else:
- raise ValueError("Unsupported implementation for unique_ptr: %s" % impl_type)
+ raise ValueError("Unsupported implementation for unique_ptr: %s" % str(impl_type))
tuple_impl_type = tuple_member.type.fields()[0].type # _Tuple_impl
tuple_head_type = tuple_impl_type.fields()[1].type # _Head_base
head_field = tuple_head_type.fields()[0]
elif head_field.is_base_class:
self.pointer = tuple_member.cast(head_field.type)
else:
- raise ValueError("Unsupported implementation for tuple in unique_ptr: %s" % impl_type)
+ raise ValueError("Unsupported implementation for tuple in unique_ptr: %s" % str(impl_type))
def children (self):
return SmartPtrIterator(self.pointer)