Add generic var and std for iterables, fix #6544

Fixes issue #6544