/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <list>
#include <iterator>
using namespace std;
int main()
{
list<int> l1{1, 2, 3, 5, 6};
list<int> l2{2, 6, 8};
auto it = l1.begin();
advance(it, 2); //works
it++; //works
// it+=2; //not work
l2.splice(l2.begin(), l1, it);
for(int a: l2) cout<<a<<" ";
cout<<endl;
return 0;
}