variant with delete_if