I'm not familiar with using forward_list, but if you like the first approach you listed, and your only problem with it is the fact that the relevant code takes five lines, then you can easily amend it to take use only four lines, thus:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
#include <string>
#include <forward_list>
int main()
{
std::forward_list<int> numbers;
std::forward_list<int>::iterator i = numbers.insert_after(numbers.before_begin(), 2);
numbers.insert_after(i, 3);
numbers.push_front(1);
// just to check the list contents
for (auto it = numbers.begin(); it != numbers.end(); ++it ) std::cout << ' ' << *it;
}
Output:
1 2 3
But then I see the second piece of code seems to work anyway, without using the iterator.