e.g., something like this: for (int i = 0; i < n; ++i) { SCOPE_MARK(i); SCOPE_ASSERT(SomethingAbout(Vector[i])); } Failure: line XX, SomethingAbout(Vector[i]), i = 4 Other proposals for syntax?