Add generic var and std for iterables, fix #6544