If you look through the STL index you will often find something you can use. In this case you could use partial_sort_copy, although I suspect it may be slower than the manual method.
Code:
#include <iostream>
#include <algorithm>
using namespace std;
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
int main(void)
{
int numbers[] = { 27, 1, 100, 53, 12 };
int smallest[2];
partial_sort_copy(numbers, numbers + ARRAY_SIZE(numbers), // Source range.
smallest, smallest + ARRAY_SIZE(smallest)); // Destination range.
copy(smallest, smallest + ARRAY_SIZE(smallest), ostream_iterator<int>(cout, " "));
cin.get();
}
[edit]I reread your post and it seems you are looking for index positions rather than values so this won't do. It looks like it's back to doing this trivial task manually, possibly with the help of for_each.[/edit]