'Store the LLVM *value* into the field at *index*.'

def __setitem__(self, index, value):

    ptr = self._get_ptr_by_index(index)
    value = self._cast_member_from_value(index, value)
    if (value.type != ptr.type.pointee):
        if (is_pointer(value.type) and is_pointer(ptr.type.pointee) and (value.type.pointee == ptr.type.pointee.pointee)):
            value = self._context.addrspacecast(self._builder, value, ptr.type.pointee.addrspace)
        else:
            raise TypeError('Invalid    store    of    {value.type}    to    {ptr.type.pointee}    in    {self._datamodel}    (trying    to    write    member    #{index})'.format(value=value, ptr=ptr, self=self, index=index))
    self._builder.store(value, ptr)
