foo.size() typically returns an unsigned integral type; make loop variables match those types' signedness.
Attach a file by drag & drop or click to upload