void OBStereo::Permutate(OBStereo::Refs &refs, int i, int j) { if (i < 0 || i >= refs.size()) return; if (j < 0 || j >= refs.size()) return; unsigned long id = refs.at(i); refs[i] = refs.at(j); refs[j] = id; }
OBStereo::Refs OBStereo::Permutated(const OBStereo::Refs &refs, int i, int j) { if (i < 0 || i >= refs.size()) return refs; if (j < 0 || j >= refs.size()) return refs; OBStereo::Refs result(refs); result[i] = refs.at(j); result[j] = refs.at(i); return result; }